Skip to content

Fixed issue [#139]#310

Open
mawen12 wants to merge 2 commits into
satnaing:mainfrom
mawen12:fix-theme-for-meta-color
Open

Fixed issue [#139]#310
mawen12 wants to merge 2 commits into
satnaing:mainfrom
mawen12:fix-theme-for-meta-color

Conversation

@mawen12

@mawen12 mawen12 commented Jun 11, 2026

Copy link
Copy Markdown

Description

When the user selects system as their theme preference, the meta[name='theme-color'] tag always sets its content to '#fff' (light mode color), regardless of the operating system's actual color scheme. This causes the browser address bar / tab bar color to mismatch the actual page theme.

The root cause is that the code uses the theme state (which can be light, dark, or system) instead of resolvedTheme (which is always light or dark after evaluating the system preference). When theme === system, the ternary expression theme === dark ? '#020817' : '#fff' always evaluates to '#fff', even if the OS is in dark mode

Types of changes

  • Bug Fix (fixes an issue)
  • New Feature (adds functionality)
  • Refactor (improves code structure without changing behavior)
  • Breaking Change (incompatible change to existing behavior or public API)
  • Others (any other types not listed above)

Checklist

Further comments

Related Issue

Closes: #309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: meta[name='theme-color'] does not update correctly when theme is set to 'system'

1 participant