Skip to content

Rem to px preset

সমস্ত utilities-এর জন্য rem-কে px-এ রূপান্তর করে।

সোর্স কোড

ইনস্টলেশন

bash
pnpm add -D @unocss/preset-rem-to-px
bash
yarn add -D @unocss/preset-rem-to-px
bash
npm install -D @unocss/preset-rem-to-px
bash
bun add -D @unocss/preset-rem-to-px
ts
import presetRemToPx from '@unocss/preset-rem-to-px'
import { defineConfig } from 'unocss'

export default defineConfig({
  presets: [
    presetRemToPx(),
    // ...other presets
  ],
})

ব্যবহার

html
<div class="m-2"></div>
css
.m-2 {
  margin: 0.5rem;
}
css
.m-2 {
  margin: 8px;
}

অপশন

baseFontSize

  • Type: number
  • Default: 16

rem-কে px-এ রূপান্তর করার জন্য base font size (1rem = n px)।

Released under the MIT License.