3 points · by vanilla-almond · 10y ago · 6 comments
I'm currently creating a website and am wondering what people's thoughts are on adopting flexbox for website layouts.
Flexbox now has good support on modern browsers, but there are still a lot of older browsers in use.
Do you think it's too early to ditch floats for layouts in CSS? Or do you think flexbox is now ready for widespread adoption?
Our product is used by their clients. Some of those people are using IE8 and 9. So the approach we take for our product marketing site and the product itself is different.
Flexbox however isn't really designed for full page layout. The UI items it is really great at are often much easier to deal with in terms of legacy support than you entire layout is. You can often use flexbox to enhance a design even if you can't go all in. I would really encourage you to have a look at this video https://www.youtube.com/watch?v=_98SE8WUvLk Zoe works for booking.com and demonstrates how they use flexbox AND ensure legacy support.
.no-flexbox { // fallbacks }
Or you could do the inverse and style with .flexbox { // enhancements } for browsers that support flexbox. Then you can "progressively enhance".
I hate both of the scare quoted terms.
E:
Or if your layout isn't too complex you can use standard fallbacks. Flex rules will be ignored by browsers that don't support them so using Modernizer is a bit overkill.
I'd suggest just using modern CSS.
Depending on whether or not they expect to have users from IE8/IE9 they should degrade/enhance properly to support the maximum amount of users. If they don't expect people to be using IE8/IE9 then just use flexbox.
For basic scenarios you can still get something acceptable for IE8/IE9 with bare minimum work.