Astro Integration
Astro için UnoCSS entegrasyonu: @unocss/astro. Örneği kontrol edin.
Installation
bash
pnpm add -D unocssbash
yarn add -D unocssbash
npm install -D unocssbash
bun add -D unocssts
import { defineConfig } from 'astro/config'
import UnoCSS from 'unocss/astro'
export default defineConfig({
integrations: [
UnoCSS(),
],
})Bir uno.config.ts dosyası oluşturun:
ts
import { defineConfig } from 'unocss'
export default defineConfig({
// ...UnoCSS seçenekleri
})Style Reset
Varsayılan olarak, tarayıcı stil sıfırlama enjekte edilmeyecektir. Etkinleştirmek için @unocss/reset paketini yükleyin:
bash
pnpm add -D @unocss/resetbash
yarn add -D @unocss/resetbash
npm install -D @unocss/resetbash
bun add -D @unocss/resetVe astro.config.ts'nizi güncelleyin:
ts
import { defineConfig } from 'astro/config'
import UnoCSS from 'unocss/astro'
export default defineConfig({
integrations: [
UnoCSS({
injectReset: true // veya sıfırlama dosyasına bir yol
}),
],
})Preset olmadan kullanım
Bu eklenti herhangi bir varsayılan preset ile gelmez.
bash
pnpm add -D @unocss/astrobash
yarn add -D @unocss/astrobash
npm install -D @unocss/astrobash
bun add -D @unocss/astrots
import UnoCSS from '@unocss/astro'
export default {
integrations: [
UnoCSS(),
],
}Daha fazla ayrıntı için lütfen Vite eklentisine bakın.
INFO
UnoCSS üzerine bir meta çerçeve oluşturuyorsanız, varsayılan preset'leri nasıl bağlayacağınıza dair bir örnek için bu dosyaya bakın.
Notes
client:only bileşenleri components klasörüne yerleştirilmeli veya işlenmek üzere UnoCSS'in content yapılandırmasına eklenmelidir.