postcss.config.js 618 B

1234567891011121314151617181920
  1. export default {
  2. plugins: {
  3. '@tailwindcss/postcss': {},
  4. 'postcss-pxtorem': {
  5. rootValue: 100, // 1rem = 100px
  6. unitPrecision: 5, // 小数精度
  7. propList: ['*'], // 所有属性都转换
  8. selectorBlackList: [
  9. /^html$/, // 不转换 html 标签
  10. /^body$/, // 不转换 body 标签
  11. ],
  12. replace: true, // 直接替换,不保留 px
  13. mediaQuery: false, // 不转换媒体查询中的 px
  14. minPixelValue: 2, // 小于 2px 的不转换(避免 1px 边框问题)
  15. exclude: /node_modules/i, // 排除 node_modules
  16. },
  17. autoprefixer: {},
  18. },
  19. }