Search code examples
webpackflexboxcreate-react-apppostcss

Automatically add css rule to flex items in Webpack


I would like to add css rule min-width:0 to all elements which are flex items -- have rule display: flex.

It helps to prevent issues in flexbox. Is there a webpack or postcss plugin which allows this? I am using mainly create-react-app as a boilerplate project and styled components.


Solution

  • There is a pretty popular postcss plugin postcss-flexbugs-fixes that helps with some issues with flexbox.