generated from shadcn-ui/registry-template-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
The meta theme-color tag is not updating correctly when users select different themes from the theme selector. This causes mobile browser status bars to display incorrect colors that don't match the selected theme.
Current Behavior
- ❌ Meta theme-color remains static regardless of user-selected theme
- ❌ Mobile browser status bar shows default colors instead of theme-specific colors
- ❌ Theme switching only updates CSS variables but not meta tag
Expected Behavior
- ✅ Meta theme-color should update dynamically when theme changes
- ✅ Mobile browser status bar should match the selected theme's background color
- ✅ Both light and dark mode variations should be supported for each theme
Root Cause Analysis
Current Implementation Issues
-
Multiple Theme Systems: There are conflicting implementations:
META_THEME_COLORS(static light/dark only) inlib/config.ts:69-72THEME_META_COLORS(theme-specific colors) inlib/config.ts:74-81
-
Theme Provider Conflict: The
components/theme-provider.tsxonly handles light/dark mode switching but doesn't consider the active theme selected by user. -
Active Theme Handler: The
components/active-theme.tsxhas proper logic but may not be executing correctly or being overridden by other theme handlers.
Code Locations
// lib/config.ts - Static meta colors (problematic)
export const META_THEME_COLORS = {
light: "#ffffff",
dark: "#13120a",
}
// lib/config.ts - Theme-specific colors (correct approach)
export const THEME_META_COLORS = {
dublin: { light: "#f5f6eb", dark: "#02060a" },
clare: { light: "#fdf6e3", dark: "#002b36" },
neobrutalism: { light: "#fefefe", dark: "#000000" },
kerry: { light: "#f9f9f9", dark: "#020700" },
cork: { light: "#dde8e8", dark: "#02060a" },
galway: { light: "#fbf7f5", dark: "#03030a" }
}Technical Details
Problem Files:
app/layout.tsx:30- Uses staticMETA_THEME_COLORS.darkapp/layout.tsx:47- Initial meta tag usesMETA_THEME_COLORS.lightcomponents/theme-provider.tsx:21-32- Only handles light/dark, ignores theme selectioncomponents/active-theme.tsx:47-65- Correct implementation but may be overridden
Impact:
- Mobile UX: Status bar colors don't match theme aesthetics
- Brand Consistency: Theme identity is broken on mobile devices
- User Experience: Jarring visual disconnect between theme and browser UI
Reproduction Steps
- Go to deltacomponents.dev/themes
- Select any theme (e.g., Kerry, Galway, Dublin)
- Open browser developer tools
- Inspect the
<meta name="theme-color" content="...">tag - Notice the content value doesn't match the selected theme
- Switch between light/dark mode and themes
- Observe that meta theme-color doesn't update accordingly
Expected Fix
The meta theme-color should dynamically update based on:
- User-selected theme (dublin, kerry, galway, etc.)
- Current light/dark mode preference
- Using the correct color from
THEME_META_COLORS[theme][mode]
Environment
- Browser: All browsers (affects mobile safari status bar most visibly)
- Device: Mobile devices show this most prominently
- Theme System: All custom themes (dublin, clare, neobrutalism, kerry, cork, galway)
Suggested Solution
- Remove dependency on static
META_THEME_COLORS - Ensure
components/active-theme.tsxtheme color update logic executes - Fix execution order so theme-specific colors aren't overridden
- Add proper error handling for missing theme colors
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working