From 618d377d8785e6878c360623414deba1a16d09c3 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 3 Nov 2026 22:22:45 +0100 Subject: [PATCH] fix(ui): keep the dark theme during page loads and wire:navigate Closes #7866 Co-Authored-By: Claude Opus 5.5 --- resources/views/layouts/base.blade.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 3cb2244b2c..acd09ca28f 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -303,13 +303,23 @@ }, }); - document.addEventListener('livewire:navigated', window.applyStoredTheme); + // wire:navigate copies the server attributes over the live ones, which removes + // the theme class and colors. Apply them again in the same task as the swap, before + // the browser can paint the new page (livewire:navigated can run after a paint). + document.addEventListener('livewire:navigating', (event) => event.detail.onSwap(window.applyStoredTheme)); window.applyStoredTheme(); })(); +