Skip to content

🐛 fix(playground): fix theme switching not working in production build#1579

Merged
harehare merged 1 commit intomainfrom
fix/playground-theme-switching
Apr 12, 2026
Merged

🐛 fix(playground): fix theme switching not working in production build#1579
harehare merged 1 commit intomainfrom
fix/playground-theme-switching

Conversation

@harehare
Copy link
Copy Markdown
Owner

Lightningcss transforms light-dark() into a @media (prefers-color-scheme) polyfill using --lightningcss-light/dark variables. Setting colorScheme via JS had no effect on these variables in the production build.

  • Update --lightningcss-light/dark CSS variables when switching themes
  • Remove duplicate :root block with hardcoded hex values to prevent CSS variable override conflicts during minification
  • Replace hardcoded hex colors with CSS variables using light-dark()
  • Fix h1 inline style using hardcoded #67b8e3 instead of CSS variable

Lightningcss transforms light-dark() into a @media (prefers-color-scheme)
polyfill using --lightningcss-light/dark variables. Setting colorScheme
via JS had no effect on these variables in the production build.

- Update --lightningcss-light/dark CSS variables when switching themes
- Remove duplicate :root block with hardcoded hex values to prevent
  CSS variable override conflicts during minification
- Replace hardcoded hex colors with CSS variables using light-dark()
- Fix h1 inline style using hardcoded #67b8e3 instead of CSS variable
@harehare harehare merged commit 9e6c1f5 into main Apr 12, 2026
4 checks passed
@harehare harehare deleted the fix/playground-theme-switching branch April 12, 2026 11:21
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.

1 participant