-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathscrollbars.css
61 lines (56 loc) · 1.91 KB
/
scrollbars.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Variables */
:root {
--scrollbar-size: .375rem;
--scrollbar-minlength: 1.5rem; /* Minimum length of scrollbar thumb (width of horizontal, height of vertical) */
--scrollbar-ff-width: thin; /* FF-only accepts auto, thin, none */
--scrollbar-track-color: transparent;
--scrollbar-color: rgba(0,0,0,.2);
--scrollbar-color-hover: rgba(0,0,0,.3);
--scrollbar-color-active: rgb(0,0,0);
}
/* Use .layout-scrollbar-obtrusive to only use overflow if scrollbars don’t overlay */
.scrollbar-test,
.layout-cell {
overscroll-behavior: contain;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
scrollbar-width: var(--scrollbar-ff-width);
}
/* This class controls what elements have the new fancy scrollbar CSS */
.layout-scrollbar {
scrollbar-color: var(--scrollbar-color) var(--scrollbar-track-color);
}
/* Only apply height/width to ::-webkit-scrollbar if is obtrusive */
.layout-scrollbar-obtrusive .layout-scrollbar::-webkit-scrollbar {
height: var(--scrollbar-size);
width: var(--scrollbar-size);
}
.layout-scrollbar::-webkit-scrollbar-track {
background-color: var(--scrollbar-track-color);
}
.layout-scrollbar::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-color);
border-radius: 3px;
}
.layout-scrollbar::-webkit-scrollbar-thumb:hover {
background-color: var(--scrollbar-color-hover);
}
.layout-scrollbar::-webkit-scrollbar-thumb:active {
background-color: var(--scrollbar-color-active);
}
.scrollbar-test::-webkit-scrollbar-thumb:vertical,
.layout-scrollbar::-webkit-scrollbar-thumb:vertical {
min-height: var(--scrollbar-minlength);
}
.scrollbar-test::-webkit-scrollbar-thumb:horizontal,
.layout-scrollbar::-webkit-scrollbar-thumb:horizontal {
min-width: var(--scrollbar-minlength);
}
@media (prefers-color-scheme: dark) {
:root {
--scrollbar-color:#555;
--scrollbar-color-hover: #555;
--scrollbar-color-active: #555;
}
}