@routerhub/agent-rules 1.4.11 → 1.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.base.md +6 -3
- package/package.json +1 -1
package/AGENTS.base.md
CHANGED
|
@@ -19,9 +19,12 @@
|
|
|
19
19
|
|
|
20
20
|
## 样式与 UI 约束
|
|
21
21
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
22
|
+
- 前端项目统一使用 Tailwind CSS 编写样式,禁止新增 `*.module.scss`、`*.module.css` 或普通 `.css` 文件。
|
|
23
|
+
- 如果项目尚未集成 Tailwind CSS,必须先完成 Tailwind 的安装和配置(包括 `tailwind.config.js/ts`、`postcss.config.js` 及在全局样式中引入 `@tailwind` 指令),再进行业务开发。
|
|
24
|
+
- 所有新增样式必须通过 Tailwind 的工具类(utility classes)在 JSX/TSX 中直接编写,禁止新建样式文件。
|
|
25
|
+
- 当 Tailwind 内置工具类无法满足需求时,优先在 `tailwind.config` 中通过 `extend` 扩展主题,其次使用 `@apply` 在全局样式中封装复合类名,最后才考虑行内 `style` 属性。
|
|
26
|
+
- 复杂或重复的样式组合应提取为 Tailwind 组件类(通过 `@apply`)或封装为 React 组件,避免工具类堆砌过长。
|
|
27
|
+
- 历史项目中已有的 `*.module.scss` 文件可保留使用,但新增功能和页面必须使用 Tailwind CSS。
|
|
25
28
|
- 不允许使用 `span` 标签选择器。
|
|
26
29
|
- 如果必须存在类名(历史代码场景),类名使用小驼峰命名,不使用下划线或中划线。
|
|
27
30
|
|