Skip to content

Commit 528dd86

Browse files
committed
Use native dark scrollbars, where available
1 parent 8a9b4a7 commit 528dd86

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/styles.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,24 @@ export const darkTheme = {
115115

116116
/* In dark theme, we need to override the scrollbars or they stick out like a sore thumb */
117117
globalCss: styledComponents.css`
118-
::-webkit-scrollbar {
119-
background-color: ${p => polished.darken(0.2, p.theme.containerBackground)};
118+
@supports (color-scheme: dark) {
119+
:root {
120+
color-scheme: dark;
121+
}
120122
}
121123
122-
::-webkit-scrollbar-thumb {
123-
background-color: ${p => polished.lighten(0.2, p.theme.containerBackground)};
124-
}
124+
@supports not (color-scheme: dark) {
125+
::-webkit-scrollbar {
126+
background-color: ${p => polished.darken(0.2, p.theme.containerBackground)};
127+
}
125128
126-
/* Standard, but poorly supported: */
127-
scrollbar-color: dark;
129+
::-webkit-scrollbar-thumb {
130+
background-color: ${p => polished.lighten(0.2, p.theme.containerBackground)};
131+
}
132+
133+
/* Standard, but poorly supported: */
134+
scrollbar-color: dark;
135+
}
128136
`
129137
};
130138

0 commit comments

Comments
 (0)