vite-plugin-px-rem-vw
v1.0.8
Published
vite plugin convert px to rem or vw
Downloads
16
Readme
vite-plugin-px-rem-vw
Integrate postcss plugin pxtorem and pxtovw in vite
Install
# pnpm
pnpm add -D vite-plugin-px-rem-vw
# yarn
yarn add -D vite-plugin-px-rem-vw
# npm
npm i -D vite-plugin-px-rem-vw
Usage
// vite.config.js
import { defineConfig } from 'vite'
import pxToRemOrVwPlugin from "vite-plugin-px-rem-vw"
export default defineConfig({
plugins: [
pxToRemOrVwPlugin({
type: 'rem',
options: {
rootValue: 20
}
}),
],
})
Options
//pxtovw
interface Vw {
type: 'vw';
options?: VwConfig;
}
//pxtorem
interface Rem {
type: 'rem';
options?: RemConfig;
}
type Options = Vw | Rem;