Ask HN: CSS – ditch floats and use flexbox?
6 comments
That would depend entirely on the browsers you need to support. For example I have a product aimed at web designers. Our support in terms of our marketing site for the up to date flexbox spec is about 98%.
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.
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.
Use Modernizer. Then you can "gracefully degrade".
.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.
.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.
http://caniuse.com/#search=flexbox
I'd suggest just using modern CSS.
I'd suggest just using modern CSS.
Good luck targeting IE8/IE9. Some users/fields still need to support that. Such as in healthcare, where many sites have to work back to IE6/IE7 (which is hell)
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.
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.
Although this is a purely philosophical disagreement, I strongly support making new web pages actively discourage the continuing use of legacy browsers.
As do I, for personal projects/personal use. When my company needs to create a functioning website in IE7 for healthcare professionals because they have to use IE7 and don't have a choice in updating then it better work in IE7...
My point was "if his target audience uses IE8 they should support IE8". It's a simple question for any dev to ask themselves and it comes with a simple answer.
If you expect to sell anything or provide a service - your competitor that supports IE8 will win a number of your customers over by supporting IE8 better than you do. If you can afford to lose those sales to a competitor, feel free to disregard IE8. (It's often only a negligible amount of sales anyways.)
I don't think anyone supports legacy browsers because they want to.
My point was "if his target audience uses IE8 they should support IE8". It's a simple question for any dev to ask themselves and it comes with a simple answer.
If you expect to sell anything or provide a service - your competitor that supports IE8 will win a number of your customers over by supporting IE8 better than you do. If you can afford to lose those sales to a competitor, feel free to disregard IE8. (It's often only a negligible amount of sales anyways.)
I don't think anyone supports legacy browsers because they want to.
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?