Use SASS (from command line) and Autoprefixer (for Bootstrap 4.x)

前端 未结 4 1453
遥遥无期
遥遥无期 2021-02-20 13:23

I have recently started using the scss files, especially to customize Bootstrap.

To compile my scss files (and also bootstrap) i use sa

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-20 13:45

    After i have installed globally post-css and autoprefixer

    npm install -g postcss-cli autoprefixer

    i run the following command to reload my CSS file with autoprefixer.

    postcss assets/theme.css --replace --use autoprefixer

    Note: I will update this post once i have worked on for one command that both handle SASS CLI and Autoprefixer

    Edit-1: You can combine 2 terminal commands and compile and minify Bootstrap SCSS, then run Autoprefixer to add vendor prefixes like this with just one command:

    sass scss/theme.scss:assets/theme.min.css --style=compressed && postcss assets/theme.min.css --replace --use autoprefixer

提交回复
热议问题