Should we always use the flex property instead of flex-grow, flex-shrink, and flex-basis properties individually?


#1

Question

Should we always use the flex property instead of flex-grow, flex-shrink, and flex-basis properties individually?

Answer

A few instances where using the flex property is unnecessary to use:

  • To set only the flex-basis and use the default flex-shrink: 1;
  • To set only the flex-basis and flex-shrink properties without specifying a flex-grow value as well, because we cannot set flex-shrink and flex-basis using two values for the flex property
  • To use only flex-shrink or flex-basis, we can however set flex-grow if we use a single value on the flex property