lightningcss-plugin-px-to-viewport
v0.0.4
Published
A lightningcss plugin that converts px to viewport width
Downloads
2
Maintainers
Readme
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,
},
});