Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix switch for multiple themes #5740

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading