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; }