diff --git a/components.json b/components.json new file mode 100644 index 0000000..4e5a9eb --- /dev/null +++ b/components.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/client/ui/theme.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "src/client/ui", + "ui": "src/client/ui", + "lib": "src/client/ui", + "utils": "src/client/ui/utils", + "hooks": "src/client/ui" + } +} diff --git a/docs/external-plugin-guide.md b/docs/external-plugin-guide.md index 57605b6..73665de 100644 --- a/docs/external-plugin-guide.md +++ b/docs/external-plugin-guide.md @@ -1004,6 +1004,32 @@ interface SettingsDescriptor { - 类名是 CSS Modules 哈希,**不是契约**;精确命中用 `[data-dsh-better-sidebar]` + 子串类名(`[class*='panel']`)或 DOM 结构。 - 改动本契约必须同步本文档、设计文档与 `tests/theme.spec.ts`。 +### 12.3 在插件里用 Tailwind / shadcn/ui + +本仓库自己的任务管理页(v0.20 起)就是这套姿势的参考实现:组件源码 vendoring 在 `src/client/ui/`,样式由 Tailwind v4 编译,颜色全部经 shadcn 语义令牌桥接到 `--dsw-*`。你的插件照做即可自动兼容全部皮肤;**接入的难点只有三条,其余都是常规 Tailwind**。 + +**① 只引 `theme` + `utilities`,绝不引 preflight。** 插件的 CSS 最终是全局 `