@any-u/unocss-preset-rem-to-vw
v0.0.0-beta.1
Published
Convert all rem to vw in utils
Downloads
1
Readme
unocss-preset-rem-to-vw
Convert all rem to vw in utils
Install
npm install @any-u/unocss-preset-rem-to-vw -D
Usage
Options
export interface RemToVwOptions {
/**
* 1rem = n px
* @default 16
*/
baseFontSize?: number
/**
* CSS 像素(逻辑像素)
* @default 375
*/
viewportWidth?: number
/**
* 精度
* @default 5
*/
unitPrecision?: number
}
Config
import { defineConfig } from 'vite'
import UnoCSS from 'unocss/vite'
import presetRemToVw from "@any-u/unocss-preset-rem-to-vw"
export default defineConfig({
plugins: [
UnoCSS({
presets: [
presetRemToVw()
],
}),
],
})