This commit is contained in:
2026-09-20 23:35:03 +08:00
parent 941ce4baab
commit 388c700996
19 changed files with 393 additions and 71 deletions

View File

@@ -21,16 +21,30 @@
--accent: #10B981;
--accent-soft: rgba(16, 185, 129, 0.12);
--accent-hover: rgba(16, 185, 129, 0.20);
/* 亮绿底 + 白字只有 2.5:1(WCAG 需 4.5),slot 序号等 accent 底色文字改深色 → 5.8:1 */
--accent-text: #1F2937;
}
:root[data-accent="orange"] {
--accent: #F59E0B;
--accent-soft: rgba(245, 158, 11, 0.12);
--accent-hover: rgba(245, 158, 11, 0.20);
/* 同 green:亮橙底 + 白字 2.2:1 → 深色 6.8:1 */
--accent-text: #1F2937;
}
:root[data-accent="red"] {
--accent: #EF4444;
--accent-soft: rgba(239, 68, 68, 0.12);
--accent-hover: rgba(239, 68, 68, 0.20);
}
}
/* Light 主题下 accent 直接作文字色对比度不足(实测 orange 2.06 / green 2.43 /
* blue 3.52,WCAG 正文需 ≥4.5)—— 文字场景(--accent-fg)改用同色系深色变体,
* 全部 ≥4.6:1;色块填充 / 边框仍用 --accent 本身,品牌色观感不变。
* 深色主题各 accent 文字对比度 ≥3.2 且多为图标/强调短文本,维持原色。 */
:root[data-theme="light"][data-accent="purple"] { --accent-fg: #4F46E5; }
:root[data-theme="light"][data-accent="blue"] { --accent-fg: #2563EB; }
:root[data-theme="light"][data-accent="green"] { --accent-fg: #047857; }
:root[data-theme="light"][data-accent="orange"] { --accent-fg: #B45309; }
:root[data-theme="light"][data-accent="red"] { --accent-fg: #DC2626; }

View File

@@ -19,8 +19,8 @@
}
/* 字体变量赋值
* 中文优先:西文(Inter)排在中文兜底之后,App 里大部分文本是中文,
* 让 YaHei/PingFang 先匹配笔画渲染,CJK 之外再走 Inter 拿更好的西文观感。 */
* 西文优先:Inter 排最前拿更好的西文/数字观感;Inter 不含 CJK 字形,
* 中文会自动落到后面的 YaHei/PingFang 兜底,两段各取所长。 */
:root {
--font-ui: 'Inter', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC',
'Hiragino Sans GB', 'Segoe UI', system-ui, -apple-system,

View File

@@ -24,7 +24,13 @@
--accent: #5E6AD2;
--accent-soft: rgba(94, 106, 210, 0.12);
--accent-hover: rgba(94, 106, 210, 0.20);
/* accent 底色上的文字色:亮色系 accent(green/orange)白字对比度仅 ~2:1,
* accents.css 对这两个色系覆盖成深色文字。 */
--accent-text: #FFFFFF;
/* accent 作「文字色」用时的取值(Tab 激活、复制按钮、外链等)。
* 默认 = accent 本身;light 主题下亮色系 accent 对比度不足,
* accents.css 按 [data-theme="light"][data-accent="..."] 覆盖成深色变体。 */
--accent-fg: var(--accent);
/* 状态色 */
--success: #10B981;
@@ -32,6 +38,7 @@
--warn-bg: rgba(245, 158, 11, 0.12);
--danger: #EF4444;
--danger-bg: rgba(239, 68, 68, 0.12);
--danger-border: rgba(239, 68, 68, 0.4);
/* 阴影 */
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);