This Sass preprocessor workflow uses cssnano for postprocessing minification and optimization that includes Autoprefixer to add vendor prefixes for only the browsers that need to be supported. Website: http://jimfrenette.com/2016/02/sass-cssnano-autoprefixer/
-
Requires Node.js
-
Download or clone this repsoitory.
-
Change directory to /uiCookbook/sass-cssnano
-
Run npm install from a bash terminal or command prompt. This will read the package.json file and install the dependencies into the sass-cssnano project folder.
npm install
- Finally, run gulp css to process the Sass into css and post process the css using cssnano
gulp css
After running gulp css, compare the optimized /css/main.css file that was created from the sass and notice that the applicable vendor prefixes have been added.
Additional reading: