Skip to content

Commit 589faab

Browse files
chenenpeinetweng
authored andcommitted
Revert "feat(eagle): Enhance Typo component with new styles and Figma mapping (#1277)"
This reverts commit 0110c87.
1 parent 1ac4630 commit 589faab

4 files changed

Lines changed: 1 addition & 144 deletions

File tree

packages/eagle/docs/llms.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ npm 包名:@cloudtower/eagle
9797
- Icon: 图标容器,统一图标尺寸和样式
9898
- BaseIcon: 基础图标,支持 SVG 图标渲染
9999
- Link: 链接,封装 antd Typography.Link
100-
- Typo: 排版样式集合,提供 Display/Heading/Label/Paragraph 等预定义的 Linaria 类名;若需要根据 Figma Typography 名称查找对应样式,请使用公开导出的 `FIGMA_TO_TYPO`
101-
- Color: 颜色 token;若目标文件已依赖全局 Sass 变量或已有 `$...` 写法,优先使用 `dist/variables.scss` 中的 Sass 变量,否则优先使用公开导出的 `Color.*`
100+
- Typo: 排版样式集合,提供 Display/Heading/Label/Paragraph 等预定义的 Linaria 类名
102101
- Loading: 加载中动画,三条竖线动画
103102
- CircleLoading: 圆形加载动画,旋转渐变圆形图标
104103
- Space: 间距组件,封装 antd Space

packages/eagle/src/core/Typo/index.ts

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ const d1s_bold_title = css`
1010
font-size: 24px;
1111
line-height: 32px;
1212
`;
13-
const d1s_regular_title = css`
14-
@include Inter();
15-
font-size: 24px;
16-
line-height: 32px;
17-
`;
1813
const d1_regular_title = css`
1914
@include Inter();
2015
font-size: 32px;
@@ -131,14 +126,6 @@ const l2_bold = css`
131126
font-size: 14px;
132127
line-height: 22px;
133128
`;
134-
const l2_bold_strikethrough = css`
135-
@include Inter(bold);
136-
text-decoration-line: line-through;
137-
text-decoration-style: solid;
138-
text-decoration-skip-ink: none;
139-
font-size: 14px;
140-
line-height: 22px;
141-
`;
142129
const l2_regular_title = css`
143130
@include Inter();
144131
font-size: 14px;
@@ -321,7 +308,6 @@ export const Typo = {
321308
Display: {
322309
d1_bold_title,
323310
d1s_bold_title,
324-
d1s_regular_title,
325311
d1_regular_title,
326312
d2_bold_title,
327313
d2_regular_title,
@@ -346,7 +332,6 @@ export const Typo = {
346332
l1_regular_title,
347333
l1_regular_upper,
348334
l2_bold,
349-
l2_bold_strikethrough,
350335
l2_bold_title,
351336
l2_bold_upper,
352337
l2_regular,
@@ -389,53 +374,3 @@ export const Typo = {
389374
u1,
390375
},
391376
} as const;
392-
393-
export const FIGMA_TO_TYPO = {
394-
"Display/display1-bold-sc": d1_bold_title,
395-
"Display/display1-regular-sc": d1_regular_title,
396-
"Display/display1s-bold-sc": d1s_bold_title,
397-
"Display/display1s-regular-sc": d1s_regular_title,
398-
"Display/display2-bold-sc": d2_bold_title,
399-
"Display/display2-regular-sc": d2_regular_title,
400-
"Display/display3-bold-sc": d3_bold_title,
401-
"Display/display3-regular-sc": d3_regular_title,
402-
"Heading/h1-bold-sc": h1_bold_title,
403-
"Heading/h1-regular-sc": h1_regular_title,
404-
"Heading/h2-bold-sc": h2_bold_title,
405-
"Heading/h2-regular-sc": h2_regular_title,
406-
"Heading/h3-bold-sc": h3_bold_title,
407-
"Heading/h3-regular-sc": h3_regular_title,
408-
"Heading/h3-bold-uppercase-sc": h3_bold_upper,
409-
"Heading/h3-regular-uppercase-sc": h3_regular_upper,
410-
"Label/label1-regular-sc": l1_regular,
411-
"Label/label1-bold-sc": l1_bold,
412-
"Label/label1-regular-uppercase-sc": l1_regular_upper,
413-
"Label/label1-bold-uppercase-sc": l1_bold_upper,
414-
"Label/label2-regular-sc": l2_regular,
415-
"Label/label2-medium-sc": l2_medium,
416-
"Label/label2-bold-sc": l2_bold,
417-
"Label/label2-regular-uppercase-sc": l2_regular_upper,
418-
"Label/label2-bold-uppercase-sc": l2_bold_upper,
419-
"Label/label2-bold-strikethrough-sc": l2_bold_strikethrough,
420-
"Label/label3-regular-sc": l3_regular,
421-
"Label/label3-semibold-sc": l3_semibold,
422-
"Label/label3-bold-sc": l3_bold,
423-
"Label/label3-regular-uppercase-sc": l3_regular_upper,
424-
"Label/label3-bold-uppercase-sc": l3_bold_upper,
425-
"Label/label4-regular-sc": l4_regular,
426-
"Label/label4-medium-sc": l4_medium,
427-
"Label/label4-bold-sc": l4_bold,
428-
"Label/label4-regular-uppercase-sc": l4_regular_upper,
429-
"Label/label4-bold-uppercase-sc": l4_bold_upper,
430-
"Footnote/footnote1-regular-sc": f1_regular,
431-
"Footnote/footnote2-regular-sc": f2_regular,
432-
"Tabular Num/tnum1-regular-monospace-sc": t1_regular_mono,
433-
"Tabular Num/tnum1-regular-slashed0-sc": t1_regular_slash,
434-
"Tabular Num/tnum2-regular-monospace-sc": t2_regular_mono,
435-
"Tabular Num/tnum2-medium-monospace-sc": t2_medium_mono,
436-
"Tabular Num/tnum2-regular-slashed0-sc": t2_regular_slash,
437-
"Tabular Num/tnum2-medium-slashed0-sc": t2_medium_slash,
438-
"Tabular Num/tnum16-bold-slashed0-sc": t16_bold_slash,
439-
} as const;
440-
441-
export type FigmaTypographyName = keyof typeof FIGMA_TO_TYPO;

skills/cloudtower-eagle-dev/SKILL.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -68,38 +68,6 @@ description: >
6868

6969
列出差异清单,由开发者确认后再修改。
7070

71-
### 6. Typography 和 Color 的维护规则
72-
73-
当修改或新增 Typography、Color 相关内容时,按下面的规则处理。
74-
75-
**Typography**
76-
77-
1. `Typo` 是对外公开的用法,现有 key 不要直接删除,也不要随意改名。
78-
2. 如果是为了和 Figma 对齐新增字体样式,要同时检查:
79-
- `Typo`
80-
- `FIGMA_TO_TYPO`
81-
- 相关测试
82-
3. 从 Figma 读取字体时,先看 design context 里的字体 token,再查 `FIGMA_TO_TYPO`
83-
4. 如果 Figma 名字和代码名字不完全一样,再按字号、行高、字重、是否大写来判断,不要只靠名字猜。
84-
85-
**Color**
86-
87-
1. `src/styles/token/color.ts``src/styles/token/color.scss` 是当前和 Figma 对齐的颜色定义。
88-
2. `src/styles/common/variables.scss` 主要用来兼容旧的 Sass 变量名,不建议继续把新颜色优先加在这里。
89-
3. 外部项目真正会用到的是 `dist/variables.scss`,所以旧的 Sass 变量名不能轻易删除或改名。
90-
4. 新颜色如果要补充,优先补到:
91-
- `token/color.ts`
92-
- `token/color.scss`
93-
5. 只有在需要兼容旧代码时,才补旧的 Sass 别名。
94-
6. 从 Figma 读取颜色时,先看 `get_design_context` 结果里的 `var(--...)`,不要先猜旧变量名。
95-
96-
**文档**
97-
98-
1. 不要在多个地方各写一份完整映射表,避免以后不同步。
99-
2. 如果这次改动会影响 agent 查找 Typography 或 Color 的方式,再同步更新:
100-
- `packages/eagle/docs/llms.txt`
101-
- `skills/cloudtower-eagle/SKILL.md`
102-
10371
## 共用规则
10472

10573
1. **始终用 package.json 定义的 script**`yarn lint`, `yarn format`, `yarn typings`, `yarn test:ci`, `yarn build-storybook`

skills/cloudtower-eagle/SKILL.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -43,48 +43,3 @@ import "@cloudtower/eagle/dist/style.css";
4343
```bash
4444
find . -path "*/@cloudtower/eagle/docs/llms.txt" 2>/dev/null
4545
```
46-
47-
## Figma Token 查找顺序
48-
49-
当任务来自 Figma 设计稿,或者你需要把 Figma 的字体、颜色 token 映射到 Eagle 代码时,按下面的顺序查,不要先猜名字。
50-
51-
### 先读 Figma MCP 返回什么
52-
53-
拿到 `get_design_context` 结果后,不要猜 token 名,按这个顺序获取信息:
54-
55-
1. 看生成代码里的 `var(--...)`
56-
2. 这里通常能直接拿到颜色 token,例如 `var(--fill/notice/light, ...)``var(--text/colorful/outstanding, ...)`
57-
3. 接着看 `These styles are contained in the design:`
58-
4. 这里通常能直接拿到字体 token,例如 `Label/label4-regular-sc`
59-
5. 如果两边都有信息,优先以生成代码里实际出现的 token 为准
60-
6. 不要假设文字一定使用 `text/...` token;某些设计系统组件会直接使用 `fill/...` token 作为文字颜色
61-
62-
### 字体
63-
64-
1. 先从 Figma design context 里提取 typography token 名。
65-
2. 优先查 `FIGMA_TO_TYPO`,找到后直接使用对应的 `Typo.*`
66-
3. 如果 Figma 名和 Eagle 导出名不完全一致,再按字号、行高、字重、是否 uppercase 归一化,选择最接近的 `Typo.*`
67-
4. 不要只靠名称猜测,必要时再看编译后的 `dist/components.css` 确认实际字体样式。
68-
69-
### 颜色
70-
71-
1. 先判断目标文件上下文,再决定输出格式。
72-
2. 如果当前文件已经有 `$...` 写法、依赖全局 Sass 变量、或者外部项目通过 `@cloudtower/eagle/dist/variables.scss` 注入样式变量,优先使用 Sass 变量。
73-
3. 这里要把 `dist/variables.scss` 当作外部项目真实消费的 Sass 变量接口;它是旧 `variables.scss` 与最新 `token/color.scss` 的并集,不要把源码 `src/**/variables.scss` 当作唯一外部事实。
74-
4. 如果当前文件是 TS/Linaria、已经在用 `Color`、或者并不依赖全局 Sass 变量,优先使用 `Color.*`
75-
5. `dist/token.css` 只用来校验 Figma token 名和 CSS 变量形式,不作为首选输出格式。
76-
6. 不要先猜旧变量名,先按 Figma token 名去查现有导出与 `dist` 产物。
77-
78-
**示例 1:Sass 上下文**
79-
80-
输入:Figma `Form / Tip` 组件,目标文件里已经有 `$text-light-secondary` 这类写法
81-
输出:
82-
- 颜色优先使用 `$fill-serious-light``$text-colorful-serious``$text-colorful-outstanding`
83-
- 字体优先使用 `Typo.Label.l4_regular`
84-
85-
**示例 2:TS/Linaria 上下文**
86-
87-
输入:Figma `Form / Tip` 组件,目标文件已经在用 `Color.*`
88-
输出:
89-
- 颜色优先使用 `Color.fill.serious.light``Color.text.colorful.serious``Color.text.colorful.outstanding`
90-
- 字体仍然优先使用 `Typo.Label.l4_regular`

0 commit comments

Comments
 (0)