Fix automatic readable text contrast for public and admin themes.
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:
@@ -39,6 +39,10 @@ export function NavbarColorPicker() {
|
||||
if (!c) return;
|
||||
document.documentElement.style.setProperty("--color-navbar", c.value);
|
||||
document.documentElement.style.setProperty("--color-navbar-text", c.text);
|
||||
document.documentElement.style.setProperty(
|
||||
"--color-navbar-text-readable",
|
||||
c.text,
|
||||
);
|
||||
try {
|
||||
localStorage.setItem("navbarColor", c.value);
|
||||
localStorage.setItem("navbarTextColor", c.text);
|
||||
@@ -58,6 +62,10 @@ export function NavbarColorPicker() {
|
||||
"--color-navbar-text",
|
||||
savedText,
|
||||
);
|
||||
document.documentElement.style.setProperty(
|
||||
"--color-navbar-text-readable",
|
||||
savedText,
|
||||
);
|
||||
}
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user