feat: unocss-preset-shadcn
All checks were successful
/ lint-build-and-check (push) Successful in 2m28s
/ depcheck (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 2m51s
/ playwright (push) Successful in 4m3s
/ surge (push) Successful in 2m31s

This commit is contained in:
mini2024
2025-03-23 22:10:38 +08:00
parent e66dc097f7
commit e42241ddc5
13 changed files with 621 additions and 77 deletions

View File

@ -1,8 +1,23 @@
// https://github.dev/unocss/unocss/tree/main/examples/vite-vue3
import { defineConfig, presetAttributify, presetWind3, transformerDirectives, transformerVariantGroup } from 'unocss';
import presetAnimations from 'unocss-preset-animations';
// import presetChinese, { chineseTypography } from 'unocss-preset-chinese';
import { presetShadcn } from 'unocss-preset-shadcn';
export default defineConfig({
// By default, `.ts` and `.js` files are NOT extracted.
// If you want to extract them, use the following configuration.
// It's necessary to add the following configuration if you use shadcn-vue or shadcn-svelte.
content: {
pipeline: {
include: [
// the default
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
'src/shadcn/components/**/*.{js,ts}',
],
},
},
presets: [
presetWind3({
/* prefix: "u-", */
@ -10,6 +25,21 @@ export default defineConfig({
dark: '.app-dark',
},
}),
presetAnimations(),
// https://github.com/unocss-community/unocss-preset-shadcn?tab=readme-ov-file#usage
// npx shadcn-vue@latest add button
presetShadcn(
{
color: 'zinc',
// With default setting for SolidUI, you need to set the darkSelector option.
darkSelector: '.app-dark',
},
{
// If you are using reka ui.
componentLibrary: 'reka',
},
),
// chineseTypography(),
// presetChinese({
// chineseType: 'simplified', // 指定文本为简体中文