Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't there a flexbox polyfill for older browsers like IE9?

Are there some problems that prevent people from creating it? Is it too complicated?

Maybe there is just no need for that?

Was it created it already and I just can't find it?

I imagine it to be a js based library and work this way:

  1. It checks if the browser supports flexbox natively;

  2. If it doesn't, it parses CSS and checks if an element has flexbox related rules;

  3. If it does, it tries to emulate these rules via javascript by calculating all positions and sizes of the children elements and position them using position: absolute;.

Basically, the same thing that Masonry and similar libraries do, but with flexbox rules. Would that be possible to do?

Edit: this question doesn't explain why it can't be done.

like image 276
Victor Marchuk Avatar asked Nov 28 '15 17:11

Victor Marchuk


People also ask

Is flexbox supported in all browsers?

Flexbox is very well supported across modern browsers, however there are a few issues that you might run into.

Is flexbox supported in Safari?

Safari versions 9 and up support the current flexbox spec without prefixes. Older Safari versions, however, require -webkit- prefixes. Sometimes min-width and max-width cause alignment problems which can be resolved with flex equivalents.

Is flexbox safe to use?

It is definitely safe to use.

What is polyfill when used in Web development?

A polyfill is a piece of code (usually JavaScript on the Web) used to provide modern functionality on older browsers that do not natively support it.


1 Answers

There is actually a library that does exactly what I wanted: https://github.com/jonathantneal/flexibility

It's in the very early phase of development, but hopefully it will be viable soon.

like image 167
Victor Marchuk Avatar answered Oct 02 '22 13:10

Victor Marchuk