-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
What happened?
Since Quasar v2.14.3, when using SSR with dark mode enabled ($q.dark.set(true)
), the page briefly flashes the light theme before settling on the dark theme. The server correctly renders the page with the body--dark
class, but on the client side, it temporarily switches to body--light
before reverting to body--dark
. This causes a noticeable visual flicker. Prior to v2.14.3 (e.g., v2.14.2), the dark mode remained consistent without this flash.
Problem occurs since this commit: c6368ba .
What did you expect to happen?
I expected the dark mode to be applied seamlessly from server to client, with the body--dark
class remaining intact throughout the rendering process, resulting in no flash of the light theme.
Reproduction URL
How to reproduce?
- Open the reproduction URL provided above.
- Observe the initial page load in the browser preview.
- Notice that the page briefly shows the light theme (white background) before switching to the dark theme (dark background).
Alternatively, in the Quasar repo:
- Clone the Quasar repo and checkout v2.14.3 (
git checkout v2.14.3
). - Navigate to
ui/dev
and install dependencies (npm install
). - Edit
ui/dev/src/App.vue
to enable dark mode:$q.dark.set(true);
- Run the SSR dev server: npm run dev:ssr.
- Open http://localhost:9000 and watch for the light theme flash before the dark theme applies.
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Plugins (quasar), SSR Mode
Platforms/Browsers
No response
Quasar info output
Relevant log output
Additional context
No response