fix(theme): make scrollbars follow the app theme instead of the OS color scheme (#1179)

On Windows with a light OS theme, scrollbars rendered light even when the
app was switched to dark. Two combined causes:

- The page never declared `color-scheme`, so Chromium colored native
  scrollbars from the OS preference. Declare `color-scheme: light` on html
  and flip it to `dark` via `html:has(> body.dark-theme)` plus the
  `.dark-theme` block itself.
- Scrollbar styling referenced `--mat-sys-*` tokens, which are never
  emitted by the current Material theme setup (mat.define-theme +
  all-component-themes does not produce system tokens). Those
  `scrollbar-color` declarations computed to `auto`, falling back to the
  native (light) scrollbar. Switch scrollbar styling to the `--app-muted-color`
  design token (defined for both themes), replace hardcoded white
  `rgba(255,255,255,.08)` thumbs, and add an explicit `scrollbar-color`
  where only `scrollbar-width: thin` was set.

Verified live in Electron via CDP in both themes: scrollbar-color resolves
and scrollbars render dark in dark theme regardless of the OS setting.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5 authored and GitHub committed 2026-07-12 17:24:49 +02:00
1 parent 54265755ee
commit a51c537bb2
8 files changed
+39 -6

No files matched your search

+21 -2
View File
@@ -108,6 +108,20 @@ body.frameless-platform #epg-navigation {
}
// ─── Base ─────────────────────────────────────────────────────────────────────
// Native UI (scrollbars, form controls, popups) must follow the app theme,
// not the OS preference. Chromium colors unstyled/native scrollbars from the
// element's color-scheme, so declare it explicitly for both themes.
html {
color-scheme: light;
}
// The root scroller (html) sits outside body.dark-theme, so flip it via
// :has(); the color-scheme declaration in .dark-theme below keeps the body
// subtree covered in engines without :has() support.
html:has(> body.dark-theme) {
color-scheme: dark;
}
body,
html {
user-select: none;
@@ -155,6 +169,7 @@ textarea,
// ─── Dark Theme ───────────────────────────────────────────────────────────────
.dark-theme {
background: var(--mat-sys-surface) !important;
color-scheme: dark;
// Refined scrollbar for dark mode
::-webkit-scrollbar {
@@ -167,11 +182,15 @@ textarea,
}
::-webkit-scrollbar-thumb {
background-color: var(--mat-sys-outline-variant);
background-color: color-mix(
in srgb,
var(--app-muted-color) 70%,
transparent
);
border-radius: 999px;
&:hover {
background-color: var(--mat-sys-outline);
background-color: var(--app-muted-color);
}
}
}
@@ -245,7 +245,8 @@ app-grid-list {
padding: 16px 20px 20px;
display: block;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
scrollbar-color: color-mix(in srgb, var(--app-muted-color) 55%, transparent)
transparent;
}
@media (max-width: 768px) {
@@ -77,7 +77,8 @@ app-grid-list.live-all-items-grid {
overflow-y: auto;
padding: 16px 20px 20px;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
scrollbar-color: color-mix(in srgb, var(--app-muted-color) 55%, transparent)
transparent;
}
.loading-indicator {
@@ -120,6 +120,8 @@
overflow-y: auto;
padding: 4px 0;
scrollbar-width: thin;
scrollbar-color: color-mix(in srgb, var(--app-muted-color) 55%, transparent)
transparent;
}
.import-item {
@@ -454,6 +454,8 @@
max-height: 240px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: color-mix(in srgb, var(--app-muted-color) 55%, transparent)
transparent;
}
.embedded-mpv-player__audio-track {
+6
View File
@@ -223,6 +223,12 @@
overflow-x: auto;
padding-bottom: 8px;
scrollbar-width: thin;
scrollbar-color: color-mix(
in srgb,
var(--app-muted-color) 55%,
transparent
)
transparent;
}
&__similar-card {
@@ -89,7 +89,8 @@
overflow-x: hidden;
padding: 6px;
scrollbar-width: thin;
scrollbar-color: var(--mat-sys-outline-variant) transparent;
scrollbar-color: color-mix(in srgb, var(--app-muted-color) 55%, transparent)
transparent;
}
// ─── Group ───────────────────────────────────────────────────────────────────
@@ -177,7 +177,8 @@ app-workspace-context-category-view {
overflow-x: hidden;
overscroll-behavior: contain;
scrollbar-width: thin;
scrollbar-color: var(--mat-sys-outline-variant) transparent;
scrollbar-color: color-mix(in srgb, var(--app-muted-color) 55%, transparent)
transparent;
}
.context-skeleton {