|
1 | 1 | @layer components { |
2 | 2 | .el-range { |
3 | | - @apply appearance-none inline-block border-0 h-1.5 shadow-none border-none outline-none; |
| 3 | + border-radius: inherit; |
| 4 | + |
| 5 | + @apply appearance-none relative inline-flex flex-col border-0 h-1.5 shadow-none border-none outline-none bg-gray-300; |
4 | 6 |
|
5 | 7 | &::-webkit-slider-thumb { |
6 | 8 | -webkit-appearance: none; |
7 | | - @apply appearance-none pointer-events-auto cursor-pointer size-5 bg-white border-black border-3 rounded-full shadow-none outline-none; |
| 9 | + @apply z-10 appearance-none -top-2 relative pointer-events-auto cursor-pointer size-5 bg-white border-black border-3 rounded-full shadow-none outline-none; |
8 | 10 | } |
9 | 11 |
|
10 | 12 | &::-moz-range-thumb { |
11 | 13 | -moz-appearance: none; |
12 | | - @apply appearance-none pointer-events-auto cursor-pointer size-5 bg-white border-black border-3 rounded-full shadow-none outline-none; |
| 14 | + @apply z-10 appearance-none -top-2 pointer-events-auto cursor-pointer size-5 bg-white border-black border-3 rounded-full shadow-none outline-none; |
13 | 15 | } |
14 | 16 |
|
15 | 17 | &[data-color="transparent"] { |
|
23 | 25 | } |
24 | 26 | } |
25 | 27 |
|
26 | | - &[data-color="white"] { |
27 | | - @apply bg-gray-300; |
28 | | - } |
29 | | - &[data-color="black"] { |
30 | | - @apply bg-gray-300; |
31 | | - } |
32 | | - &[data-color="gray"] { |
33 | | - @apply bg-gray-300; |
34 | | - } |
35 | 28 | &[data-color="emerald"] { |
36 | | - @apply bg-gray-300; |
| 29 | + &::-webkit-slider-thumb { |
| 30 | + @apply border-emerald-500; |
| 31 | + } |
| 32 | + &::-moz-range-thumb { |
| 33 | + @apply border-emerald-500; |
| 34 | + } |
37 | 35 | } |
38 | | - &[data-color="sky"] { |
39 | | - @apply bg-gray-300; |
| 36 | + } |
| 37 | + |
| 38 | + .el-range-container { |
| 39 | + @apply relative flex flex-col; |
| 40 | + |
| 41 | + &[data-color="emerald"] { |
| 42 | + input::-webkit-slider-thumb { |
| 43 | + @apply border-emerald-500; |
| 44 | + } |
| 45 | + input::-moz-range-thumb { |
| 46 | + @apply border-emerald-500; |
| 47 | + } |
| 48 | + |
| 49 | + .el-range-tooltip, |
| 50 | + .el-range-progress { |
| 51 | + @apply bg-emerald-500; |
| 52 | + } |
40 | 53 | } |
| 54 | + |
41 | 55 | &[data-color="rose"] { |
42 | | - @apply bg-gray-300; |
43 | | - } |
44 | | - &[data-color="purple"] { |
45 | | - @apply bg-gray-300; |
46 | | - } |
47 | | - &[data-color="yellow"] { |
48 | | - @apply bg-gray-300; |
| 56 | + input::-webkit-slider-thumb { |
| 57 | + @apply border-rose-500; |
| 58 | + } |
| 59 | + input::-moz-range-thumb { |
| 60 | + @apply border-rose-500; |
| 61 | + } |
| 62 | + |
| 63 | + .el-range-tooltip, |
| 64 | + .el-range-progress { |
| 65 | + @apply bg-rose-500; |
| 66 | + } |
49 | 67 | } |
50 | | - &[data-color="amber"] { |
51 | | - @apply bg-gray-300; |
| 68 | + } |
| 69 | + |
| 70 | + .el-range-tooltip-container { |
| 71 | + @apply absolute bottom-full pb-2 -translate-x-1/2 left-0 min-w-3; |
| 72 | + will-change: left; |
| 73 | + } |
| 74 | + |
| 75 | + .el-range-tooltip { |
| 76 | + @apply bg-black p-1 text-xs font-semibold text-white; |
| 77 | + } |
| 78 | + |
| 79 | + .el-range-ticks { |
| 80 | + @apply flex flex-row justify-between w-full min-h-1; |
| 81 | + |
| 82 | + option { |
| 83 | + @apply bg-gray-300 w-px flex-none min-h-0; |
52 | 84 | } |
53 | 85 | } |
| 86 | + |
| 87 | + .el-range-progress { |
| 88 | + @apply absolute left-0 top-0 bg-black h-1.5 z-0; |
| 89 | + border-radius: inherit; |
| 90 | + will-change: width; |
| 91 | + } |
54 | 92 | } |
0 commit comments