postcss.config.js 863 B

1234567891011121314151617181920212223
  1. export default {
  2. plugins: {
  3. '@tailwindcss/postcss': {},
  4. 'postcss-px-to-viewport': {
  5. viewportWidth: 375, // 设计稿宽度
  6. viewportHeight: 812, // 设计稿高度
  7. unitPrecision: 5, // 转换后的小数精度
  8. viewportUnit: 'vw', // 转换的单位
  9. selectorBlackList: [
  10. /^html$/, // 不转换 html 标签
  11. /^body$/, // 不转换 body 标签
  12. /^#root$/, // 不转换根容器,保证 max-width 固定为 px
  13. /\.content-card$/, // 不转换主内容卡片宽度(保持 600px 封顶)
  14. /\.ignore$/, // 不转换 .ignore 类
  15. ],
  16. minPixelValue: 1, // 小于该值的 px 不转换(保留 1px 边框)
  17. mediaQuery: false, // 不转换媒体查询中的 px
  18. exclude: /node_modules/i, // 排除 node_modules
  19. },
  20. autoprefixer: {},
  21. },
  22. }