evrone / postcss-px-to-viewport

A plugin for PostCSS that generates viewport units (vw, vh, vmin, vmax) from pixel units. The best choice to create a scalable interface on different displays by one design size.
https://evrone.com/postcss-px-viewport
MIT License
2.99k stars 401 forks source link

include 个人示例。 #112

Closed ZhaoYu8 closed 2 years ago

ZhaoYu8 commented 2 years ago

npm 不行的请使用cnpm;

  1. cnpm i https://github.com/evrone/postcss-px-to-viewport --save-dev;
  2. 项目根目录新建 postcss.config.js 文件夹
    module.exports = {
      plugins: {
        autoprefixer: {},
        'postcss-px-to-viewport': {
          viewportWidth: 1920, // UI设计稿的宽度
          include: [/orderBoard.vue/] // 特定的vue文件转换
        }
      }
    };
  3. include 单个文件直接看上面代码
  4. include 文件夹直接最底层的文件夹名称即可。
    include: [/order/]
gitsheny commented 1 year ago

@ZhaoYu8 请问如何特定的scss文件