Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari 5-6 support for Individual Sizing #14

Open
hexalys opened this issue Oct 6, 2013 · 7 comments
Open

Safari 5-6 support for Individual Sizing #14

hexalys opened this issue Oct 6, 2013 · 7 comments

Comments

@hexalys
Copy link

hexalys commented Oct 6, 2013

Overall Safari 5 and 6 support the flex grid (without flow) though the old box-flex model. But the big bummer is the fixed size, or 'Individual Sizing" as per your demo page, which does not seem to work even if the 'fixed' width percentage is overridden with !important and/or flexis set to none. It seems that it is "flexed" no matter what and ignore the forced width.

If you are thinking of any hackish ways around that issue, that would be great.
Otherwise it's use is pretty limited for Safari 5 and 6. Thanks

@hexalys
Copy link
Author

hexalys commented Oct 6, 2013

I actually now resolved this by applying '-webkit-box-flex' with an css :not() selector with something like this:

.Grid > .Grid-cell:not(.u-1of3){
-webkit-box-flex: 1;/* Safari 3-6*/
}

That way, Safari respect the u-xofx width (as per your syntax), without applying the flexbox model to those boxes, and withouth the need to use 'none !important' or '!important' in those rules.
Something you could probably keep in mind to make the css cleaner and preserve Safari compatibility.

@hexalys
Copy link
Author

hexalys commented Oct 27, 2013

Actually, it turns out your demo is missing the display: -webkit-box; necessary for Safari. That's all there is to it... I got confused there because of it.

You need to add support for the old 2009 model with:
display: -webkit-box;
display: -moz-box;

@philipwalton
Copy link
Owner

These properties should be added by autoprefixer, and as far as I can tell, they are. Which specific components are you not seeing them on?

@hexalys
Copy link
Author

hexalys commented Oct 27, 2013

That's theoretically in the autoprefixer specs AFAIK too. Though your demo site http://philipwalton.github.io/ does not have them, and the site displays the warning: "Your browser does not support Flexbox. Parts of this site may not appear as expected." when browsing with Safari 5.1 or 6. So there is an issue somewhere.

@philipwalton
Copy link
Owner

The flexbox detection logic simply checks for the presence of the property flex or webkit-flex so that explains why it doesn't work in Safari 5.1 and 6.0. This is what I want because the older box syntax doesn't quite do everything needed for these demos.

If you're seeing something I could add to make it work in older Safari let me know, although I think this is much less of an issue now that Safari 6.1 and 7.0 have been released, which fully support the newest spec.

@hexalys
Copy link
Author

hexalys commented Oct 27, 2013

It's okay for the context of your showcase I guess. Though IMO autoprefixer should be adding it and saying the Flexbox support is only 'partial', instead of saying it's not supported...

I am working on a 'ready to use' framework with a different approach here, including what the 'box' syntax can handle, for backward compatibility. So in my case, I really need it. I am just using your showcase as a side reference.

@philipwalton
Copy link
Owner

As far as I can tell autoprefixer is adding it. Unless you can point me to an instance where it's not.

The alert saying flexbox isn't supported is something I'm doing and has nothing to do with autoprefixer. I suppose I could update the alert to say flexbox is only partially supported in those browsers. Maybe I'll do that if I detect support for box or ms-flexbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants