fix(tokens): 暗色卡片内控件面改用 --iwb-field(D10)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m43s

暗色下节点卡里的下拉框/任务卡是 #1a1a1a / #151515,卡片却是 #3d3d3d
—— 差 33~39 级,看着是「在卡片上挖了几个洞」(用户验收反馈)。

根因:卡片内控件吃的是 --iwb-panel / --iwb-layer,这两个是贴着应用
底色派生的(panel #1c / layer #16),而节点卡是画布派生的 #3d,两者
不在同一亮度带。D6 把 layer 钉成「比 panel 暗」只对**面板里**成立。

- 新增 --iwb-field:卡片内控件面,跟 nodeBg 相对派生
  (亮 #ffffff / 暗 mix(nodeBg,#fff,6%) = #494949),差降到 12 级
- 8 处节点内控件切过去:task / gen 参数框 / 节点内 input / 输出组 /
  进度条 / 组合与批量来源行
- field 进 textSurfaces:控件变亮后正文重夹,暗色 text #d1→#e3、
  text2 #aa→#ba、textDim #8a→#98(实测 7.02 / 4.64 / 3.12)
- pluginInset 暗色 #101010→#191919(对 pluginCard 差 28 级 → 19 级)
- 修 .iwb-node .iwb-btn-primary 的文字色(白字压浅灰 1.2:1 → --iwb-bg 13.9:1)
- 亮色 12 张基线逐像素 0 diff,暗色 4 张已重建
This commit is contained in:
qiqi committed 2026-11-23 14:10:07 +08:00
1 parent d2b1a15878
commit 69e98b9ecc
10 files changed
+86 -22

No files matched your search

+12 -2
View File
@@ -114,6 +114,12 @@
* 改成相对画布派生、两套主题都往白走:亮色 72%、暗色 6%,
* depth 拉到 0/60 两端也都保证 nodeBg 不低于 canvas。 */
const nodeBg = mix(canvas, '#ffffff', d ? 0.06 : 0.72)
/* 卡片内的控件面(输入框 / 下拉 / 任务卡 / 输出组):亮色=白,暗色=比节点**亮**一档。
* 旧实现让这些控件吃 --iwb-panel(#1c1c1c) / --iwb-layer(#161616),而节点是画布派生的 #3d3d3d
* —— 一张 #3d 的卡片里嵌着 #16 的方框,视觉上是「挖了个黑洞」(用户 2026-11-23 反馈)。
* panel/layer 夹在应用底色附近,本身没问题;错的是「拿面板色的控件去铺在画布色的卡片上」。
* 所以这里跟着 nodeBg 派生(与 nodeBg←canvas 同一套相对派生思路),暗色往白走一档。 */
const field = d ? mix(nodeBg, '#ffffff', 0.06) : '#ffffff'
/* —— 结构层(先算表面,文字要用它们做夹紧) ——
* 这里的四个公式必须与 style.css 的 :root color-mix 完全一致:
@@ -130,7 +136,9 @@
const surface = surface1
const pluginSurface = d ? mix(surface0, '#ffffff', 0.07) : mix(surface1, '#000000', 0.035)
const pluginCard = d ? mix(surface0, '#ffffff', 0.11) : surface1
const pluginInset = d ? mix(surface0, '#000000', 0.12) : mix(surface1, '#000000', 0.075)
/* 暗色内嵌块旧值 #101010:插件卡片是 #2c2c2c,差 28 级 —— 搜索框/列表底看着是「黑窟窿」。
* 改成从面板色往下压 10%(#191919),与卡片差 10 级:仍是凹槽,但不再发黑。 */
const pluginInset = d ? mix(surface1, '#000000', 0.10) : mix(surface1, '#000000', 0.075)
const pluginHover = d ? mix(surface0, '#ffffff', 0.16) : mix(surface1, '#000000', 0.11)
/* 浮层底(右键菜单 / 更多菜单 / 确认框)。浮层要「比它盖住的东西亮」:
* 亮色直接用 panel(最白);暗色如果也用 panel(#1c1c1c),浮在画布(#313131)上反而更暗 ——
@@ -139,7 +147,7 @@
/* 承载文字的整套表面。canvas 不在内 —— 画布上只有节点标题,另有专用色。
* 顺序无关,clampAgainst 取最差者。 */
const textSurfaces = [surface0, surface1, inset, surface2, surface3, nodeBg, hover, dockBg, chrome, pluginSurface, pluginCard, pluginInset, pluginHover]
const textSurfaces = [surface0, surface1, inset, surface2, surface3, nodeBg, field, hover, dockBg, chrome, pluginSurface, pluginCard, pluginInset, pluginHover]
const text = clampAgainst(mix(N, t, 0.06), textSurfaces, RATIO.text)
const text2 = clampAgainst(mix(N, t, d ? 0.30 : 0.34), textSurfaces, RATIO.text2)
@@ -179,6 +187,7 @@
layer: inset,
layer2: d ? surface1 : '#ffffff',
nodeBg,
field,
canvasBg: canvas,
chrome,
homeBg,
@@ -224,6 +233,7 @@
s('--iwb-layer', tokens.layer)
s('--iwb-layer2', tokens.layer2)
s('--iwb-node-bg', tokens.nodeBg)
s('--iwb-field', tokens.field)
s('--iwb-plugin-surface', tokens.pluginSurface)
s('--iwb-plugin-card', tokens.pluginCard)
s('--iwb-plugin-inset', tokens.pluginInset)