Skip to content

Commit 5a39ace

Browse files
authored
Merge pull request #5740 from Laravel-Backpack/fix-switch-for-multiple-themes
fix switch for multiple themes
2 parents 046533b + e5eed5d commit 5a39ace

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$field['value'] = old_empty_or_null($field['name'], '') ?? $field['value'] ?? $field['default'] ?? '0';
44
$field['onLabel'] = $field['onLabel'] ?? '';
55
$field['offLabel'] = $field['offLabel'] ?? '';
6-
$field['color'] = $field['color'] ?? 'primary';
6+
$field['color'] = $field['color'] ?? 'var(--bg-switch-checked-color)';
77
@endphp
88

99
{{-- Wrapper --}}
@@ -14,7 +14,7 @@
1414

1515
<div class="d-inline-flex align-items-center">
1616
{{-- Switch --}}
17-
<label class="form-switch switch switch-sm switch-label switch-pill switch-{{ $field['color'] }} mb-0" style="--bg-switch-checked-color: {{ $field['color'] }};">
17+
<label class="form-switch switch switch-sm switch-label switch-pill switch-{{ $field['color'] }} mb-0" @if($field['color'] !== 'var(--bg-switch-checked-color)') style="--bg-switch-checked-color: {{ $field['color'] }};" @endif>
1818
<input
1919
type="hidden"
2020
name="{{ $field['name'] }}"

0 commit comments

Comments
 (0)