【问题标题】:How can I prefix scss style files?如何为 scss 样式文件添加前缀?
【发布时间】:2020-11-18 05:35:33
【问题描述】:

我尝试为我的 scss 文件添加前缀,我找到了 autoprefixer,但它只适用于 CSS,有没有办法让它适用于 scss 文件。

自动前缀命令:

npm install postcss-cli autoprefixer
npx postcss *.css --use autoprefixer -d build/

谢谢

【问题讨论】:

    标签: javascript html css angular sass


    【解决方案1】:

    Autoprefixer 可以轻松地与 Sass 和 Stylus 集成,因为它在 CSS 已经编译后运行。

    参考:https://css-tricks.com/autoprefixer/

    这个Stack Overflow answer 解释了如何在 Angular 和 scss 文件中使用 Autofixer。

    更新:这是使用 scss 运行 postcss/autoprefixer 的命令。

    postcss --parser postcss-scss -u autoprefixer --autoprefixer.browsers \"last 2 versions\" -r src/**/*.scss

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-30
      • 2014-01-26
      • 2018-11-10
      • 1970-01-01
      • 1970-01-01
      • 2018-11-01
      相关资源
      最近更新 更多