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?
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
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.
As mentioned in the official documentation:
To enable CSS Grid prefixing, add
/* autoprefixer grid: autoplace */
to the top of your CSS file.
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂