postcss.config.js 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. module.exports = {
  2. plugins: {
  3. autoprefixer: {
  4. overrideBrowserslist: [
  5. "Android 4.1",
  6. "iOS 7.1",
  7. "Chrome > 31",
  8. "ff > 31",
  9. // "ie >= 8",
  10. "last 10 versions", // 所有主流浏览器最近10版本用
  11. ],
  12. grid: true,
  13. },
  14. 'postcss-import': {},
  15. 'postcss-px-to-viewport': {
  16. 'unitToConvert': "px", // 要转化的单位
  17. 'viewportWidth': 415, // 视窗的宽度,对应的是我们设计稿的宽度
  18. // 'viewportHeight': 896, // 视窗的高度
  19. 'unitPrecision': 5, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
  20. 'propList': ["*"], // 指定转换的css属性的单位,*代表全部css属性的单位都进行转换
  21. 'viewportUnit': 'vw', // 指定需要转换成的视窗单位,建议使用vw
  22. 'fontViewportUnit': "vw", // 指定字体需要转换成的视窗单位,默认vw
  23. 'selectorBlackList': [], // 指定不转换为视窗单位的类
  24. 'minPixelValue': 1, // 小于或等于`1px`不转换为视窗单位
  25. 'mediaQuery': true, // 允许在媒体查询中转换`px`
  26. 'exclude': /(\/|\\)(node_modules)(\/|\\)/,
  27. 'include': [],// src/views/webgl/DashBoard.vue'
  28. 'landscape': true, // 是否处理横屏情况
  29. 'landscapeUnit': 'vh',
  30. 'landscapeWidth': 415
  31. }
  32. }
  33. }