forked from darkroomengineering/aniso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_scroll.scss
114 lines (98 loc) · 2.14 KB
/
_scroll.scss
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
@import 'styles/_functions';
html:not(.has-scroll-init) {
overflow: hidden;
}
html.has-scroll-smooth {
overflow: hidden;
overflow: clip;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
html:not(.has-scroll-smooth) {
[data-scroll-section] {
transform: unset !important;
}
}
html.has-scroll-dragging {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
html.has-scroll-smooth body {
overflow: hidden;
overflow: clip;
}
html.has-scroll-smooth [data-scroll-container] {
min-height: 100vh;
}
html[data-scroll-direction='horizontal'] [data-scroll-container] {
height: 100vh;
display: inline-block;
white-space: nowrap;
}
html[data-scroll-direction='horizontal'] [data-scroll-section] {
display: inline-block;
vertical-align: top;
white-space: nowrap;
height: 100%;
}
.c-scrollbar {
position: absolute;
right: 0;
top: 0;
width: 10px;
height: 100%;
z-index: 999;
}
html[data-scroll-direction='horizontal'] .c-scrollbar {
width: 100%;
height: 10px;
top: auto;
bottom: 0;
}
.c-scrollbar_thumb {
position: absolute;
top: 0;
right: 0;
background: red;
cursor: grab;
width: 9px;
border: 2px solid transparent;
background-clip: padding-box;
border-radius: 16px;
}
html.has-scroll-dragging .c-scrollbar_thumb {
cursor: grabbing;
}
html[data-scroll-direction='horizontal'] .c-scrollbar_thumb {
right: auto;
bottom: 0;
}
[data-scroll-section] {
position: relative;
}
// custom scrollbar even on native scroll
@include desktop {
html {
overflow: overlay;
&::-webkit-scrollbar {
/* This is more usable for users trying to click it. */
background-color: rgba(0, 0, 0, 0);
-webkit-border-radius: 100px;
width: 10px; /* 1px wider than Lion. */
}
&::-webkit-scrollbar-thumb:vertical {
/* This is the EXACT color of Mac OS scrollbars.
Yes, I pulled out digital color meter */
background: red;
background-clip: padding-box;
border: 2px solid rgba(0, 0, 0, 0);
-webkit-border-radius: 100px;
min-height: 10px; /* Prevent it from getting too small */
}
}
}