Skip to content

Commit 0662abd

Browse files
fazxesclaude
andcommitted
fix: scrollbar styling for WKWebView dark mode
- Add color-scheme property to enable WKWebView scrollbar theming - Custom scrollbar styles with warm brown-tinted thumb - Transparent track for clean appearance - Proper dark mode support with lighter thumb color 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 241fc3f commit 0662abd

1 file changed

Lines changed: 30 additions & 21 deletions

File tree

‎src/globals.css‎

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@
103103
}
104104

105105
:root {
106+
/* Enable system color scheme for proper scrollbar colors in WKWebView */
107+
color-scheme: light dark;
108+
106109
--radius: 0.65rem;
107110

108111
/* Brand palette */
@@ -197,6 +200,9 @@
197200

198201
/* Dark theme */
199202
html.dark {
203+
/* Force dark color scheme for scrollbars in WKWebView */
204+
color-scheme: dark;
205+
200206
/* Brand palette - adjusted for dark */
201207
--brand-oat: oklch(0.35 0.015 60); /* Darkened */
202208
--brand-clay: oklch(0.55 0.08 55); /* Lighter for contrast */
@@ -390,37 +396,40 @@ html.dark {
390396
}
391397
}
392398

393-
/* Hide native scrollbar in Radix ScrollArea - use only custom scrollbar */
394-
[data-radix-scroll-area-viewport] {
395-
scrollbar-width: none !important;
396-
-ms-overflow-style: none !important;
397-
}
398-
399-
[data-radix-scroll-area-viewport]::-webkit-scrollbar {
400-
display: none !important;
401-
}
402-
403-
/* Custom scrollbar - outside layer for higher specificity */
399+
/* Scrollbar styling for WKWebView */
404400
::-webkit-scrollbar {
405-
width: 6px !important;
406-
height: 6px !important;
401+
width: 8px;
402+
height: 8px;
403+
background: transparent;
407404
}
408405

409406
::-webkit-scrollbar-track {
410-
background: transparent !important;
407+
background: transparent;
411408
}
412409

413410
::-webkit-scrollbar-thumb {
414-
background: color-mix(in oklch, var(--muted-foreground) 40%, transparent) !important;
415-
border-radius: 3px !important;
411+
background: oklch(0.55 0.02 60 / 50%);
412+
border-radius: 4px;
413+
border: 2px solid transparent;
414+
background-clip: padding-box;
416415
}
417416

418417
::-webkit-scrollbar-thumb:hover {
419-
background: color-mix(in oklch, var(--muted-foreground) 60%, transparent) !important;
418+
background: oklch(0.55 0.02 60 / 70%);
419+
background-clip: padding-box;
420+
}
421+
422+
::-webkit-scrollbar-corner {
423+
background: transparent;
424+
}
425+
426+
/* Dark mode scrollbar */
427+
html.dark ::-webkit-scrollbar-thumb {
428+
background: oklch(0.65 0.02 60 / 40%);
429+
background-clip: padding-box;
420430
}
421431

422-
/* Firefox scrollbar */
423-
* {
424-
scrollbar-width: thin !important;
425-
scrollbar-color: color-mix(in oklch, var(--muted-foreground) 40%, transparent) transparent !important;
432+
html.dark ::-webkit-scrollbar-thumb:hover {
433+
background: oklch(0.65 0.02 60 / 60%);
434+
background-clip: padding-box;
426435
}

0 commit comments

Comments
 (0)