-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathrange.css
64 lines (64 loc) · 1.79 KB
/
range.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
61
62
63
64
.range {
appearance: none;
-webkit-appearance: none;
--range-shdw: theme(colors.base-content);
@apply rounded-box overflow-hidden bg-transparent;
&:focus-visible::-webkit-slider-thumb {
--focus-shadow: 0 0 0 6px theme(colors.base-100) inset, 0 0 0 2rem var(--range-shdw) inset;
}
&:focus-visible::-moz-range-thumb {
--focus-shadow: 0 0 0 6px theme(colors.base-100) inset, 0 0 0 2rem var(--range-shdw) inset;
}
&::-webkit-slider-runnable-track {
@apply rounded-box bg-base-content/10 h-2 w-full;
}
&::-moz-range-track {
@apply rounded-box bg-base-content/10 h-2 w-full;
}
&::-webkit-slider-thumb {
@apply rounded-box bg-base-100 relative h-6 w-6 border-none;
appearance: none;
-webkit-appearance: none;
top: 50%;
color: var(--range-shdw);
transform: translateY(-50%);
--filler-size: 100rem;
--filler-offset: 0.6rem;
box-shadow:
0 0 0 3px var(--range-shdw) inset,
var(--focus-shadow, 0 0),
calc(var(--filler-size) * -1 - var(--filler-offset)) 0 0 var(--filler-size);
}
&::-moz-range-thumb {
@apply rounded-box bg-base-100 relative h-6 w-6 border-none;
top: 50%;
color: var(--range-shdw);
--filler-size: 100rem;
--filler-offset: 0.5rem;
box-shadow:
0 0 0 3px var(--range-shdw) inset,
var(--focus-shadow, 0 0),
calc(var(--filler-size) * -1 - var(--filler-offset)) 0 0 var(--filler-size);
}
&-primary {
--range-shdw: theme(colors.primary);
}
&-secondary {
--range-shdw: theme(colors.secondary);
}
&-accent {
--range-shdw: theme(colors.accent);
}
&-success {
--range-shdw: theme(colors.success);
}
&-warning {
--range-shdw: theme(colors.warning);
}
&-info {
--range-shdw: theme(colors.info);
}
&-error {
--range-shdw: theme(colors.error);
}
}