Search code examples
reactjscreate-react-apppostcssautoprefixer

How do you enable Autoprefixer CSS Grid translations in create-react-app without using control comments?


I am trying to enable Autoprefixer Grid translations in a Create React App application.

I do not want to eject.

I'm also using a CSS-in-JS solution that makes it impossible to add comments to the CSS. So the /* autoprefixer grid: autoplace */ control comment method is not possible.

Is it still possible to enable grid translations without ejecting?


Solution

  • At the time of asking, it was not possible. It is now though.

    If you apply an AUTOPREFIXER_GRID = autoplace environment variable when you are compiling your code, you can enable grid translations without using control comments.

    You can read about how to do this in the Autoprefixer documentation.