Refactor iframe theme accent sync

This commit is contained in:
thePR0M3TH3AN committed 2026-01-13 20:48:05 -05:00
1 parent 2215e0254d
commit a697a1de5f
5 files changed
+116 -35

No files matched your search

+9 -1
View File
@@ -133,16 +133,25 @@ const applyAccentOverrides = (root, theme) => {
? accentOverrides[theme]
: null;
let hasOverrides = false;
Object.entries(ACCENT_CSS_VARIABLES).forEach(([token, cssVariable]) => {
const overrideValue = themeOverrides ? themeOverrides[token] : null;
const normalized = normalizeAccentValue(overrideValue);
if (normalized) {
root.style.setProperty(cssVariable, normalized);
hasOverrides = true;
} else {
root.style.removeProperty(cssVariable);
}
});
if (hasOverrides) {
root.dataset.themeAccent = "override";
} else {
root.removeAttribute("data-theme-accent");
}
};
const updateThemeColorMeta = (theme) => {
@@ -369,4 +378,3 @@ export const initThemeController = () => {
applyTheme(initialTheme, { persist: true });
refreshThemeControls(document);
};