I am currently using Sass in my ExpressJS code and have been able to generate a css file using the following command -
postcss main.css -u autoprefixer -d dist/
The css file BEFORE using autoprefixer has the following code :
.container {
display: grid;
grid-template-columns: 2px 2px;
}
The css file AFTER using autoprefixer has the following code + some commented sourceMappingURL:
.container {
display: grid;
grid-template-columns: 2px 2px;
}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL21haW4uY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsYUFBYTtFQUNiLDhCQUE4QjtBQUNoQyIsImZpbGUiOiJtYWluLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5jb250YWluZXIge1xuICBkaXNwbGF5OiBncmlkO1xuICBncmlkLXRlbXBsYXRlLWNvbHVtbnM6IDJweCAycHg7XG59XG4iXX0= */
The expected css output (as per autoprefixer.github.io) should be :
.container {
display: -ms-grid;
display: grid;
-ms-grid-columns: 2px 2px;
grid-template-columns: 2px 2px;
}
My confusion is two-part.
Hope I have explained my question clearly enough. Thanks in advance!
.browserslistrc
in the root of your project or a browserslist
key in your package.json
that would tell autoprefixer which browsers are you targeting, so it takes defaults
. browserl.ist would help to visualize that (please compare defaults
with last 4 version
to see the difference in coverage).browserslist
in the root of your project and explicitly indicate the baseline of browsers you are targeting. Here you will find examples on how to construct your queries. Don't worry about source maps - there's nothing you have to do on that side.Note: Prior to prefix Grid for IE11 (if that's your case), I encourage you to get aquatinted with CSS Grid in IE: CSS Grid and the New Autoprefixer