关于postcss:vue中px转rem插件

1.amfe-flexible

  • 依据网页宽度主动更改html字体大小
  • yarn add amfe-flexible -S
  • npm i amfe-flexible -S
  • main.js中引入import "amfe-flexible"

2.postcss

  • 下载yarn add postcss postcss-pxtorem@5.1.1 -D
  • 主动将px转换为rem
  • 根目录下创立postcss.config.js文件
module.exports = {
  plugins: {
    'postcss-pxtorem': {
      rootValue: 37.5,
      propList: ['*']
    }
  }
}

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理