Fix automatic readable text contrast for public and admin themes.
Local Build and Deploy / deploy (push) Successful in 55s

Derive admin/public text colors from WCAG contrast, unify ThemeVars CSS emission, and keep navbar overrides in sync with readable vars.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-07-15 20:41:34 +02:00
1 parent 9d4d409b77
commit d7278c77f9
9 files changed
+205 -176

No files matched your search

+4 -4
View File
@@ -40,12 +40,14 @@ export function adminPaletteCss(admin: AdminPalette): string {
`--admin-sidebar-background:${admin.sidebar};`,
`--admin-sidebar-text-readable:${admin.sidebarText};`,
`--admin-sidebar-muted-readable:color-mix(in srgb, var(--admin-sidebar-text-readable) 60%, transparent);`,
`--admin-input-text-readable:${readableColor(admin.text, [admin.canvas, admin.surface])};`,
`--admin-input-text-readable:${admin.text};`,
`--admin-canvas:${admin.canvas};`,
`--admin-surface:${admin.surface};`,
`--admin-surface-elevated:${admin.surfaceElevated};`,
`--admin-text:${admin.text};`,
`--admin-text-readable:${admin.text};`,
`--admin-text-muted:${admin.muted};`,
`--admin-text-muted-readable:${admin.muted};`,
`--admin-border:${admin.border};`,
`--admin-accent:${admin.accent};`,
`--admin-accent-text:${admin.accentText};`,
@@ -104,9 +106,7 @@ export function themePaletteCss(
`--color-${status}-subtle:color-mix(in srgb, ${palette[`color_${status}`]} 14%, ${palette.color_surface});`,
`--color-${status}-border:color-mix(in srgb, ${palette[`color_${status}`]} 38%, transparent);`,
]),
adminPaletteCss(admin),
);
if (adminOverrides || selector !== ":root") {
declarations.push(adminPaletteCss(admin));
}
return `${selector}{${declarations.join("")}}`;
}