box-flex
was previously used in the old flexbox specification where only one "flexibility" value needed to be specified instead of separate values for "growing", "shrinking", and "basis". Today, you can use more detailed specifications.
NEW OLD
flex:1 1 auto; == box-flex:1;
flex:1 0 auto; == no equivalent
The multiple specifications in flexbox can be confusing due to different functionalities in each spec. It is advisable to establish fallbacks later on, especially when using -grow
, -shrink
, -basis
, and -wrap
, which may require a completely different layout as a backup plan.
If you are new to flexbox, it's recommended to start with the modern [almost] standard syntax found at
Afterwards, add support for older browsers selectively - focusing on MSIE10 and old -webkit-
syntaxes (for targeting ancient Android devices). The -moz-
syntax is generally deemed unnecessary in this context.
To cater to android 2 users, utilizing the old syntax is essential. Avoid relying on flex-wrap since it lacks support in outdated browsers (even some newer versions like Firefox), opt for flex:1 1 auto;
as other values are not viable with the old syntax. Features like space-between and other modern flexbox enhancements may not function well in the former flexbox specs (excluding the 2011 version); hence, it's best to avoid them if possible. Essentially, stick to these safe properties/values:
flex:
set to 1 1 auto
flex-direction:
(box-orient)
justify-content: flex-start | flex-end | center
(box-pack)
align-items: flex-start | flex-end | center | baseline | stretch
(box-align)