Skip to content

Commit 0a0a10c

Browse files
committed
support transparent range
1 parent a7ca4cc commit 0a0a10c

File tree

6 files changed

+74
-3
lines changed

6 files changed

+74
-3
lines changed

resources/css/components/range.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@layer components {
2+
.el-range {
3+
@apply appearance-none inline-block border-0 h-1.5;
4+
5+
&::-webkit-slider-thumb {
6+
-webkit-appearance: none;
7+
@apply appearance-none pointer-events-auto cursor-pointer size-5 bg-white border-black border-3 rounded-full;
8+
}
9+
10+
&::-moz-range-thumb {
11+
-moz-appearance: none;
12+
@apply appearance-none pointer-events-auto cursor-pointer size-5 bg-white border-black border-3 rounded-full;
13+
}
14+
15+
&[data-color="transparent"] {
16+
@apply bg-transparent;
17+
18+
&::-webkit-slider-thumb {
19+
@apply bg-transparent border-transparent;
20+
}
21+
&::-moz-range-thumb {
22+
@apply bg-transparent border-transparent;
23+
}
24+
}
25+
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+
&[data-color="emerald"] {
36+
@apply bg-gray-300;
37+
}
38+
&[data-color="sky"] {
39+
@apply bg-gray-300;
40+
}
41+
&[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;
49+
}
50+
&[data-color="amber"] {
51+
@apply bg-gray-300;
52+
}
53+
}
54+
}

resources/css/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
@import "./components/checkbox.css";
1717
@import "./components/radio.css";
1818
@import "./components/select.css";
19+
@import "./components/range.css";

resources/views/components/button/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
$iconAttributes = is_object($icon) ? $icon->attributes : new \Illuminate\View\ComponentAttributeBag();
3535
@endphp
3636

37-
<x-kit::button.icon :icon="$icon" :offset="$offset" :size="$size" :badge="$badge" :attributes="$iconAttributes" />
37+
<x-kit::button.icon :icon="$icon" :offset="$offset" :badge="$badge" :attributes="$iconAttributes" />
3838
@endif
3939

4040
@if ($slot->hasActualContent() || $content)
@@ -65,7 +65,7 @@
6565
: new \Illuminate\View\ComponentAttributeBag();
6666
@endphp
6767

68-
<x-kit::button.icon :icon="$iconRight" :offset="$offset" :size="$size" :attributes="$iconAttributes" />
68+
<x-kit::button.icon :icon="$iconRight" :offset="$offset" :attributes="$iconAttributes" />
6969
@endif
7070

7171
<span class="el-loader">
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@props([
2+
'disabled' => false,
3+
'required' => false,
4+
'color' => 'black',
5+
])
6+
7+
<input {{ $attributes->class(['el-range']) }} type="range" data-color="{{ $color }}" @disabled($disabled)
8+
@required($required) />

resources/views/components/switch/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
])
88

99
<input {!! $attributes->class(['el-switch']) !!} data-color="{{ $color }}" type="{{ $type }}" @disabled($disabled)
10-
@checked($checked) @required($required)>
10+
@checked($checked) @required($required) />

workbench/resources/views/demo.blade.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,14 @@ class="w-1/2 rounded-md ring-1 ring-inset" />
503503
</div>
504504
</div>
505505

506+
<div class="isolate flex flex-col">
507+
<div class="p-3">
508+
<h1 class="font-semibold">Range</h1>
509+
</div>
510+
<div class="flex grow items-center justify-center gap-2 border-b border-gray-200">
511+
<x-kit::range color="transparent" class="rounded-md" />
512+
</div>
513+
</div>
506514

507515
</div>
508516
</body>

0 commit comments

Comments
 (0)