Skip to content

fix(ui): render native scrollbars/controls dark in dark theme (Windows)#3922

Merged
louis030195 merged 1 commit into
mainfrom
fix/3746-dark-theme-color-scheme
Jun 9, 2026
Merged

fix(ui): render native scrollbars/controls dark in dark theme (Windows)#3922
louis030195 merged 1 commit into
mainfrom
fix/3746-dark-theme-color-scheme

Conversation

@louis030195

@louis030195 louis030195 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

before vs after

Problem

Closes #3746.

On Windows in dark theme, the scrollbar and some native controls render light and look broken against the dark UI.

Root cause: the app theme is class-based (.dark on <html>, toggled by the theme provider), but the color-scheme CSS property was only ever set inside @media (prefers-color-scheme: …) fallbacks. So when a user selects the dark theme while their OS is in light mode (extremely common on Windows), color-scheme stays light and the WebView keeps painting the default light scrollbar / native controls.

OS = light, app theme = dark

BEFORE                                   AFTER
┌───────────────────────────┬─┐         ┌───────────────────────────┬─┐
│ dark app content          │█│ ← light │ dark app content          │▓│ ← dark
│                           │ │   track │                           │ │   track
│                           │░│ on dark │                           │▒│ matches
└───────────────────────────┴─┘         └───────────────────────────┴─┘

Fix (CSS-only)

Bind color-scheme to the theme classes in globals.css:

  • :root { color-scheme: light; }
  • .dark { color-scheme: dark; }

Chromium/WebView2 then paints native scrollbars and form controls to match the selected theme, independent of the OS setting. .dark follows :root in source order at equal specificity, so dark wins when html.dark is set.

Testing

CSS-only change using a standard property. I don't have a Windows box in this environment to capture the before/after, so this is verified by inspection: color-scheme is the documented mechanism for theming native scrollbars/controls on Chromium, and the bug is precisely that it was gated behind prefers-color-scheme instead of the app's theme class. Worth a quick visual confirmation on a Windows build before merge.

🤖 Generated with Claude Code

Closes #3746.

The theme is class-based (`.dark` on <html>), but `color-scheme` was only ever
set inside `@media (prefers-color-scheme)` fallbacks. So when a user picks the
dark theme while their OS is in light mode (common on Windows), the WebView kept
painting the default light scrollbar and native controls in an otherwise dark UI,
which looks broken.

Bind `color-scheme` to the app theme classes: `light` on `:root`, `dark` on
`.dark`. The WebView/Chromium then paints native scrollbars and form controls to
match the selected theme regardless of the OS setting. CSS-only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@louis030195 louis030195 merged commit 2b6fd2f into main Jun 9, 2026
14 of 15 checks passed
@hugoaap-code

Copy link
Copy Markdown

Hey @louis030195 @Anshgrover23 check this, scrollbar and button rendering the same as before...
I'm on v2.5.27

Image

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] Scrollbar And Button Styling Look Broken In Windows Dark Theme

2 participants