@routerhub/agent-rules 1.5.74 → 1.5.75
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 -0
- package/package.json +1 -1
- package/rules/frontend.md +6 -0
package/AGENTS.base.md
CHANGED
|
@@ -239,6 +239,12 @@ Closes #456
|
|
|
239
239
|
- 复杂/重复样式提取为 Tailwind 组件类或 React 组件,避免工具类堆砌。
|
|
240
240
|
- 类名小驼峰,禁止 `span` 标签选择器。
|
|
241
241
|
|
|
242
|
+
## 前端尺寸单位规范
|
|
243
|
+
|
|
244
|
+
- ⚠️ **前端项目所有尺寸单位必须使用 `rem`,禁止使用 `px`**。包括但不限于:`width`、`height`、`margin`、`padding`、`font-size`、`border-radius`、`gap`、`line-height`、`top`、`left`、`right`、`bottom` 等所有 CSS 属性的数值。
|
|
245
|
+
- 根元素 `html` 的 `font-size` 默认设置为 `16px`(即 `1rem = 16px`),设计稿中的 `px` 值需转换为 `rem`(公式:`rem = px / 16`)。
|
|
246
|
+
- Tailwind CSS 的 spacing 配置需同步改为 `rem` 单位,禁止在 `tailwind.config` 中使用 `px` 值。
|
|
247
|
+
|
|
242
248
|
## 组件复用
|
|
243
249
|
|
|
244
250
|
- 优先复用已有组件,能通过 `props` 定制就不建新组件;新功能尽量封装为可复用组件。
|
package/package.json
CHANGED
package/rules/frontend.md
CHANGED
|
@@ -38,6 +38,12 @@ outputName: "frontend"
|
|
|
38
38
|
- 复杂/重复样式提取为 Tailwind 组件类或 React 组件,避免工具类堆砌。
|
|
39
39
|
- 类名小驼峰,禁止 `span` 标签选择器。
|
|
40
40
|
|
|
41
|
+
## 前端尺寸单位规范
|
|
42
|
+
|
|
43
|
+
- ⚠️ **前端项目所有尺寸单位必须使用 `rem`,禁止使用 `px`**。包括但不限于:`width`、`height`、`margin`、`padding`、`font-size`、`border-radius`、`gap`、`line-height`、`top`、`left`、`right`、`bottom` 等所有 CSS 属性的数值。
|
|
44
|
+
- 根元素 `html` 的 `font-size` 默认设置为 `16px`(即 `1rem = 16px`),设计稿中的 `px` 值需转换为 `rem`(公式:`rem = px / 16`)。
|
|
45
|
+
- Tailwind CSS 的 spacing 配置需同步改为 `rem` 单位,禁止在 `tailwind.config` 中使用 `px` 值。
|
|
46
|
+
|
|
41
47
|
## 组件复用
|
|
42
48
|
|
|
43
49
|
- 优先复用已有组件,能通过 `props` 定制就不建新组件;新功能尽量封装为可复用组件。
|