generated from hchiam/learning-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscroll-indicator-shadow-overlay.css
48 lines (48 loc) · 1.13 KB
/
scroll-indicator-shadow-overlay.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
.overlay-scroll-shadow-y {
--shadow-color: rgba(0, 0, 0, 0.25);
--shadow-cover-color: white;
/* inherit or currentColor won't work here */
--shadow-height: 10px;
padding-block: 0 !important;
}
.overlay-scroll-shadow-y::before,
.overlay-scroll-shadow-y::after {
content: "";
position: sticky;
display: block;
width: 100%;
height: var(--shadow-height);
background: var(--shadow-cover-color);
z-index: 2;
}
.overlay-scroll-shadow-y::before {
top: calc(-1 * var(--shadow-height));
margin-bottom: calc(-1 * var(--shadow-height));
}
.overlay-scroll-shadow-y::after {
bottom: calc(-1 * var(--shadow-height));
margin-top: calc(-1 * var(--shadow-height));
}
.overlay-scroll-shadow-y .shadow-top,
.overlay-scroll-shadow-y .shadow-bottom {
position: sticky;
width: 100%;
height: var(--shadow-height);
z-index: 1;
}
.overlay-scroll-shadow-y .shadow-top {
top: 0;
background: radial-gradient(
ellipse at top,
var(--shadow-color),
transparent 70%
);
}
.overlay-scroll-shadow-y .shadow-bottom {
bottom: 0;
background: radial-gradient(
ellipse at bottom,
var(--shadow-color),
transparent 70%
);
}