Skip to content

Commit 2cfa84a

Browse files
committed
remove faulty class
1 parent 8b714cb commit 2cfa84a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/resources/views/crud/fields/switch.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
$field['onLabel'] = $field['onLabel'] ?? '';
55
$field['offLabel'] = $field['offLabel'] ?? '';
66
$field['color'] = $field['color'] ?? 'var(--bg-switch-checked-color, black)';
7+
$switchClass = (str_starts_with($field['color'], 'var(') || str_starts_with($field['color'], '#')) ? '' : 'switch-'.$field['color'];
78
@endphp
89

910
{{-- Wrapper --}}
@@ -14,7 +15,7 @@
1415

1516
<div class="d-inline-flex align-items-center">
1617
{{-- Switch --}}
17-
<label class="form-switch switch switch-sm switch-label switch-pill mb-0" @if($field['color'] !== 'var(--bg-switch-checked-color, black)') style="--bg-switch-checked-color: {{ $field['color'] }};" @endif>
18+
<label class="form-switch switch switch-sm switch-label switch-pill mb-0 {{$switchClass}}" @if($field['color'] !== 'var(--bg-switch-checked-color, black)') style="--bg-switch-checked-color: {{ $field['color'] }};" @endif>
1819
<input
1920
type="hidden"
2021
name="{{ $field['name'] }}"

0 commit comments

Comments
 (0)