Skip to content

Commit 94c51bd

Browse files
committed
actually add custom scrollbar css
1 parent b7967a5 commit 94c51bd

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
@media (prefers-color-scheme: dark) {
2+
:root {
3+
--scrollbar-thumb-color: #444;
4+
--scrollbar-track-color: #223;
5+
}
6+
}
7+
8+
@media (prefers-color-scheme: light) {
9+
:root {
10+
--scrollbar-thumb-color: #ccc;
11+
--scrollbar-track-color: #f8f8f8;
12+
}
13+
}
14+
15+
::-webkit-scrollbar {
16+
width: 16px;
17+
height: 16px;
18+
}
19+
20+
::-webkit-scrollbar-corner,
21+
::-webkit-scrollbar-track {
22+
background-color: var(--scrollbar-track-color);
23+
}
24+
25+
::-webkit-scrollbar-thumb {
26+
background-color: var(--scrollbar-thumb-color);
27+
background-clip: padding-box;
28+
border: 2px solid transparent;
29+
}
30+
31+
/* Buttons */
32+
::-webkit-scrollbar-button:single-button {
33+
background-color: var(--scrollbar-track-color);
34+
display: block;
35+
background-size: 10px;
36+
background-repeat: no-repeat;
37+
}
38+
39+
/* Up */
40+
::-webkit-scrollbar-button:single-button:vertical:decrement {
41+
height: 12px;
42+
width: 16px;
43+
background-position: center 4px;
44+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='var(--scrollbar-track-color)'><polygon points='50,00 0,50 100,50'/></svg>");
45+
}
46+
47+
/* Down */
48+
::-webkit-scrollbar-button:single-button:vertical:increment {
49+
height: 12px;
50+
width: 16px;
51+
background-position: center 2px;
52+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='var(--scrollbar-track-color)'><polygon points='0,0 100,0 50,50'/></svg>");
53+
}
54+
55+
/* Left */
56+
::-webkit-scrollbar-button:single-button:horizontal:decrement {
57+
height: 12px;
58+
width: 12px;
59+
background-position: 3px 3px;
60+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='var(--scrollbar-track-color)'><polygon points='0,50 50,100 50,0'/></svg>");
61+
}
62+
63+
/* Right */
64+
::-webkit-scrollbar-button:single-button:horizontal:increment {
65+
height: 12px;
66+
width: 12px;
67+
background-position: 3px 3px;
68+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='var(--scrollbar-track-color)'><polygon points='0,0 0,100 50,50'/></svg>");
69+
}

0 commit comments

Comments
 (0)