Skip to content

A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy injectors to reality checkers. Each agent is a specialized expert with personality, processes, and proven deliverables.

Shell

Make UX Architect theme toggles work when clicking nested labels

Rudy Celeklic74ab1db0705
diff --git a/design/design-ux-architect.md b/design/design-ux-architect.md
index 06c0e09e..4b231826 100644
--- a/design/design-ux-architect.md
+++ b/design/design-ux-architect.md
@@ -246,9 +246,13 @@ class ThemeManager {
const toggle = document.querySelector('.theme-toggle');
if (toggle) {
toggle.addEventListener('click', (e) => {
- if (e.target.matches('.theme-toggle-option')) {
- const newTheme = e.target.dataset.theme;
- this.applyTheme(newTheme);
+ const option = e.target instanceof Element
+ ? e.target.closest('.theme-toggle-option') : null;
+ if (option && toggle.contains(option)) {
+ const newTheme = option.dataset.theme;
+ if (['system', 'light', 'dark'].includes(newTheme)) {
+ this.applyTheme(newTheme);
+ }
}
});
}