Skip to content

Commit

Permalink
Merge pull request #5740 from Laravel-Backpack/fix-switch-for-multipl…
Browse files Browse the repository at this point in the history
…e-themes

fix switch for multiple themes
  • Loading branch information
pxpm authored Dec 20, 2024
2 parents 046533b + e5eed5d commit 5a39ace
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resources/views/crud/fields/switch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$field['value'] = old_empty_or_null($field['name'], '') ?? $field['value'] ?? $field['default'] ?? '0';
$field['onLabel'] = $field['onLabel'] ?? '';
$field['offLabel'] = $field['offLabel'] ?? '';
$field['color'] = $field['color'] ?? 'primary';
$field['color'] = $field['color'] ?? 'var(--bg-switch-checked-color)';
@endphp

{{-- Wrapper --}}
Expand All @@ -14,7 +14,7 @@

<div class="d-inline-flex align-items-center">
{{-- Switch --}}
<label class="form-switch switch switch-sm switch-label switch-pill switch-{{ $field['color'] }} mb-0" style="--bg-switch-checked-color: {{ $field['color'] }};">
<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>
<input
type="hidden"
name="{{ $field['name'] }}"
Expand Down

0 comments on commit 5a39ace

Please sign in to comment.