themes lol

This commit is contained in:
2026-08-23 17:17:04 -07:00
parent 0a7b5fa00f
commit 6f575d6a23
79 changed files with 13108 additions and 278 deletions
+18
View File
@@ -8,6 +8,24 @@ export const CHROME_COLORS: Record<
dark: { base: "#242424", dimmed: "#161616" },
};
// theme-color meta ownership: while a drawer holds a dimmed color, base
// writes (from scheme/theme changes) must not overwrite it.
let dimmedDepth = 0;
export function setBaseThemeColor(color: string): void {
if (dimmedDepth === 0) setThemeColorMeta(color);
}
export function pushDimmedThemeColor(color: string): void {
dimmedDepth++;
setThemeColorMeta(color);
}
export function popDimmedThemeColor(base: string): void {
dimmedDepth = Math.max(0, dimmedDepth - 1);
if (dimmedDepth === 0) setThemeColorMeta(base);
}
export function setThemeColorMeta(color: string): void {
if (typeof document === "undefined") return;