{{-- Runs before paint to prevent a flash of the wrong theme. Placed in . --}}