Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 577 Bytes

File metadata and controls

26 lines (22 loc) · 577 Bytes

lightningcss-plugin-px-to-viewport

Usage

// using with vite

import { defineConfig } from "vite";
import { composeVisitors } from "lightningcss";
import createPxToVwVisitor from "lightningcss-plugin-px-to-viewport";

export default defineConfig({
  css: {
    transform: "lightningcss",
    lightningcss: {
      visitor: composeVisitors([
        createPxToVwVisitor({
          designWidth: 320,
          minPixelValue: 1,
          excludeSelectors: [{ type: 'class', name: /^mui-/ }] // exclude `.mui-*` class
        }),
      ]),
    } as any,
  },
});