{{-- The theme, decided before the first paint. Include it in , ahead of @vite. It reads the visitor's choice from localStorage (`livewire-material.theme.storage_key`): `light`, `dark` or `system`, falling back to `theme.default`. `system` follows the operating system, now and whenever it changes. The result is written to , which is the only thing the stylesheet keys on; the choice itself is , where `$store.theme` picks it up. A value under one of `theme.legacy_keys` — an earlier toggle's key, which may be JSON-encoded (maryUI's `"dark"`) — is adopted once and removed. Nothing is written for a visitor who never chose, so changing `theme.default` later reaches them too. survives wire:navigate, so this only has to run on a full load. --}} @php $theme = config('livewire-material.theme'); $settings = [ 'default' => in_array($theme['default'] ?? null, ['light', 'dark', 'system'], true) ? $theme['default'] : 'system', 'key' => $theme['storage_key'] ?? 'material-theme', 'legacy' => array_values($theme['legacy_keys'] ?? []), ]; @endphp