Files
iwb-plugins-desktop/promptlib/TOKEN-MAPPING.md
T

48 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# promptlib Token 迁移映射表(第一批:颜色)
> 依据:`image-workbench-desktop/docs/standards/design-tokens.md` 与 `plugin-theme.md`。
> 原则:**视觉目标仍是 1.8.8 基线**;先迁颜色(语义明确),尺寸后续单独批次 + 截图 diff。
## 1. 颜色映射(已落地 1.8.22)
| 原值 | Token | 用途 |
| --- | --- | --- |
| `#fff` / `#ffffff`(background) | `--iwb-plugin-card` | 卡片/弹窗内白底 |
| `#fbfcfd` / `#fcfcfd` | `--iwb-field` | 输入框/编辑区底 |
| `#fafafb` / `#fafbfc` | `--iwb-plugin-surface` | 面板根 |
| `#f5f6f7` `#f3f4f7` `#f2f4f7` `#eef0f4` `#f4f5f7` `#f4f6f9` `#f1f3f5` | `--iwb-plugin-inset` | 内嵌/分组底 |
| `#eef0f3` `#eef1f4` `#e9ecf1` `#e7e9ee` `#d7dbe2` | `--iwb-plugin-hover` | 悬停/次级块 |
| `#d5d9e0` `#e3e5e9` `#e6e8ec` `#eceef2` `#e2e6ec` `#e8eaee` `#eef0f2` `#dfe3e9` `#f1f3f5` `#f3f5f8` `#eef0f3` | `--iwb-plugin-border` | 常规描边/分割线 |
| `#b9bfca` `#c2c7cf` `#9aa3ad` | `--iwb-border2` | 强调描边 |
| `#1d2129` `#1c2333` `#2f3540` `#3f4450` `#3a4048` `#33383f` | `--iwb-text` | 主文字 |
| `#5b6472` `#4d5668` `#8b929c` `#8a919c` | `--iwb-text2` | 次要文字 |
| `#9aa1ac` `#aab0ba` `#b3b9c2` `#c2c7cf` | `--iwb-text-dim` | 占位/弱说明 |
| `#5a3fd0` `#5a4bd0` `#7c4dff` `#6b4dff` `#8b7ff0` | `--iwb-plp-accent` | 插件强调色(高饱和,允许自有) |
| `#f1ecff` `#f4f0ff` | `--iwb-plp-accent-soft` | 强调色浅底 |
| `#cfc3ff` `#d8cbff` `#d9d3ff` | `--iwb-plp-accent-border` | 强调色描边 |
| `#d97706` | `--iwb-warn` | 警告 |
| `#c0392b` | `--iwb-err` | 错误/删除 |
白色文字(压在封面/渐变上)保留 `#fff`,属内容色。
## 2. 尺寸迁移(已完成 1.8.23)
迁移结果:promptlib 散值清零(字号/圆角/间距全部落入闭集),棘轮基线已下调;视觉对比无换行/溢出。
| 类别 | 目标闭集 | 归并规则 |
| --- | --- | --- |
| 字号 | 11/12/13/14/15/17/20/24 | 10→11、10.5→11、11.5→12、12.5→13、13.5→14、16→15、18→17 |
| 圆角 | 6/8/10/12/14/999 | 2/3/4→6、7/9→8、11→10、16→14 |
| 间距 | 0/2/4/6/8/10/12/16/20/24/32/40/48/64 | 1→2、3→4、5→6、7→6、9→8、14→12、18→16 |
尺寸批次要求:亮/暗两套截图 diff + 逐项确认后再发布。
## 3. 复查命令
```bash
node scripts/token-audit.js --plugins
node tests/plugin-theme-contract-test.js
node tests/plugin-scale-contract-test.js
npm run test:visual
```