fix(theme): readable on-accent text color and unified accent aliases

Solid-accent buttons used the page text color (--lora-text) or white,
which falls below WCAG AA on the mid-bright accent (L 52-72%) in every
theme/preset — e.g. ~1.7:1 in dark+solarized, making primary buttons
hard to read. Add --color-accent-contrast (dark, low-chroma, same hue,
derived per preset) aliased as --text-on-accent, and switch ~90
accent-background selectors (primary/confirm buttons, nav items, chips,
badges, checkmarks) to it.

Also define the previously dangling --lora-accent-l/c/h, --lora-accent-hover
and --lora-accent-light aliases (fixing ~40 dead declarations), replace the
hardcoded rgba(--lora-accent-rgb, 79 70 229) fallbacks with oklch channel
syntax, and add the missing margin above .template-custom-input in
settings.
This commit is contained in:
Will Miao
2026-10-10 20:41:10 +08:00
parent 3d165f92e0
commit c0165919b3
34 changed files with 129 additions and 103 deletions
+7
View File
@@ -24,6 +24,13 @@
--color-accent-border: oklch(var(--color-accent-l) var(--color-accent-c) var(--color-accent-h) / 0.25);
--color-accent-transparent: oklch(var(--color-accent-l) var(--color-accent-c) var(--color-accent-h) / 0.6);
/* Text/icon color on top of a solid accent background. The accent is a
mid-to-bright color (L 52-72%) in every theme/preset, so a dark,
low-chroma color of the same hue reads far better than white or the
page text color (WCAG: dark on L60% accent ≈ 4.4:1, white ≈ 3.5:1).
Derived from --color-accent-h so every preset picks it up. */
--color-accent-contrast: oklch(20% 0.02 var(--color-accent-h));
--color-warning: oklch(var(--color-warning-l) var(--color-warning-c) var(--color-warning-h));
--color-warning-bg: oklch(var(--color-warning-l) var(--color-warning-c) var(--color-warning-h) / 0.15);
--color-warning-border: oklch(var(--color-warning-l) var(--color-warning-c) var(--color-warning-h) / 0.3);