Skip to content

Commit 99a79fd

Browse files
committed
align scrollbar style across non-mobile browsers
1 parent 97d9ce7 commit 99a79fd

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

src/css/base.css

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,40 @@ object[type="image/svg+xml"]:not([width]) {
108108
opacity: 0.5;
109109
}
110110

111-
@supports (scrollbar-width: thin) {
111+
@media (pointer: fine) {
112+
html {
113+
scrollbar-color: var(--scrollbar-thumb-color) var(--panel-background);
114+
}
115+
112116
body * {
113117
scrollbar-width: thin;
114118
scrollbar-color: var(--scrollbar-thumb-color) transparent;
115119
}
116-
}
117120

118-
body ::-webkit-scrollbar {
119-
height: 0.25rem;
120-
width: 0.25rem;
121-
}
121+
html::-webkit-scrollbar {
122+
background-color: var(--panel-background);
123+
height: 12px;
124+
width: 12px;
125+
}
122126

123-
body ::-webkit-scrollbar-thumb {
124-
background-color: var(--scrollbar-thumb-color);
127+
body ::-webkit-scrollbar {
128+
height: 6px;
129+
width: 6px;
130+
}
131+
132+
::-webkit-scrollbar-thumb {
133+
background-clip: padding-box;
134+
background-color: var(--scrollbar-thumb-color);
135+
border: 3px solid transparent;
136+
border-radius: 12px;
137+
}
138+
139+
body ::-webkit-scrollbar-thumb {
140+
border-width: 1.75px;
141+
border-radius: 6px;
142+
}
143+
144+
::-webkit-scrollbar-thumb:hover {
145+
background-color: var(--scrollbar_hover-thumb-color);
146+
}
125147
}

src/css/vars.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
--panel-background: var(--color-smoke-30);
3737
--panel-border-color: var(--color-smoke-90);
3838
--scrollbar-thumb-color: var(--color-gray-10);
39+
--scrollbar_hover-thumb-color: #9c9c9c;
3940
/* navbar */
4041
--navbar-background: var(--color-jet-80);
4142
--navbar-font-color: var(--color-white);

0 commit comments

Comments
 (0)