Skip to content

a vite plugin Integrate pxtorem and pxtovw plugins for develop mobile

License

Notifications You must be signed in to change notification settings

zscumt123/vite-plugin-px-rem-vw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

a vite plugin Integrate pxtorem and pxtovw plugins for develop mobile

Resources

License

Stars

Watchers

Forks

Packages

No packages published