Skip to content

Astro Integration

Astro-এর জন্য UnoCSS integration: @unocss/astroexample check করুন।

Installation

bash
pnpm add -D unocss
bash
yarn add -D unocss
bash
npm install -D unocss
bash
bun add -D unocss
ts
import { defineConfig } from 'astro/config'
import UnoCSS from 'unocss/astro'

export default defineConfig({
  integrations: [
    UnoCSS(),
  ],
})

একটি uno.config.ts file তৈরি করুন:

ts
import { defineConfig } from 'unocss'

export default defineConfig({
  // ...UnoCSS options
})

Style Reset

Default হিসাবে, browser style reset inject করা হবে না। এটি enable করতে, @unocss/reset package install করুন:

bash
pnpm add -D @unocss/reset
bash
yarn add -D @unocss/reset
bash
npm install -D @unocss/reset
bash
bun add -D @unocss/reset

এবং আপনার astro.config.ts আপডেট করুন:

ts
import { defineConfig } from 'astro/config'
import UnoCSS from 'unocss/astro'

export default defineConfig({
  integrations: [
    UnoCSS({
      injectReset: true // or a path to the reset file
    }),
  ],
})

Presets ছাড়া ব্যবহার

এই plugin-এ কোনো default presets নেই।

bash
pnpm add -D @unocss/astro
bash
yarn add -D @unocss/astro
bash
npm install -D @unocss/astro
bash
bun add -D @unocss/astro
ts
import UnoCSS from '@unocss/astro'

export default {
  integrations: [
    UnoCSS(),
  ],
}

আরো বিস্তারিত জানার জন্য, অনুগ্রহ করে Vite plugin দেখুন।

INFO

আপনি যদি UnoCSS-এর উপরে একটি meta framework build করছেন, default presets কিভাবে bind করতে হয় তার একটি example-এর জন্য এই file দেখুন।

Notes

client:only components অবশ্যই components folder-এ রাখতে হবে বা UnoCSS-এর content config-এ যোগ করতে হবে যাতে এগুলি process করা যায়।

Released under the MIT License.