feat(tokens): 新增 --iwb-accent-on-surface / --iwb-accent-tint 并接入生成链
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m27s

「强调色当文字用」以前各插件各自混色,暗色下对比度不足。现在固化成两个语义 token:

- --iwb-accent-on-surface = color-mix(--iwb-brand 45%, --iwb-text):文字/图标用的安全强调色
- --iwb-accent-tint = color-mix(--iwb-brand 18%, transparent):选中标签/药丸的淡底
  两者都是关系式(跟随主题与自定义强调色),不写死 hex

生成链:scripts/gen-tokens.js 的 LIGHT_ONLY 表 → src/design-tokens.css / dist/tokens.json
(npm run tokens:write 重生成,tokens:check 守卫)

落地:
- plugins/promptlib 1.14.7:参考图药丸改用这两个 token
- style.css:质量档位选中态、右键菜单 hover 底改用这两个 token(顺手去掉两处散落的 12% mix)
- docs/standards/design-tokens.md 新增 §3.9:取值、成对用法、四条规则(填充用 brand / 文字用 accent-on-surface 等)
This commit is contained in:
qiqi committed 2026-11-28 20:48:09 +08:00
1 parent 73a56c60f2
commit 04cc527002
7 files changed
+39 -8

No files matched your search

+2 -2
View File
@@ -800,7 +800,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-ctx-title { font-size: var(--iwb-font-2xs); font-weight: 700; color: var(--iwb-text2); letter-spacing: 1px; padding: 6px 10px 2px; text-transform: uppercase; } /*iwb:raw-until=3.28.0*/
.iwb-ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: none; border-radius: 8px; background: transparent; color: var(--iwb-text); font-size: var(--iwb-font-sm); cursor: pointer; text-align: left; }
.iwb-ctx-item .iwb-ic { width: var(--iwb-icon-sm); height: var(--iwb-icon-sm); flex: 0 0 auto; color: var(--iwb-text2); }
.iwb-ctx-item:hover:not(:disabled) { background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); color: var(--iwb-text); }
.iwb-ctx-item:hover:not(:disabled) { background: var(--iwb-accent-tint); color: var(--iwb-text); }
.iwb-ctx-item:hover:not(:disabled) .iwb-ic { color: var(--iwb-brand-text, var(--iwb-brand)); }
.iwb-ctx-item:disabled { opacity: 0.38; cursor: default; }
.iwb-ctx-item.iwb-ctx-danger { color: var(--iwb-err); }
@@ -1650,7 +1650,7 @@ body .iwb-history-embedded .iwb-history-item.iwb-history-selected:hover img {
.iwb-quality-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.iwb-settings-modal .iwb-quality-toggle input { width: 100%; height: 100%; border-radius: var(--iwb-radius-full); }
.iwb-quality-toggle:hover { background: var(--iwb-hover); }
.iwb-quality-toggle.on { color: var(--iwb-brand-text, var(--iwb-brand)); font-weight: 600; background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); }
.iwb-quality-toggle.on { color: var(--iwb-accent-on-surface); font-weight: 600; background: var(--iwb-accent-tint); }
.iwb-shape-hint { flex: 1 1 100%; margin-top: 2px; }
/* v3.87.39 顶部状态栏:加半透明白底 + 背景模糊,避免叠在图片/内容上时文字看不清 */