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

Flash of Light Theme in SSR with Dark Mode Since v2.14.3 #17953

Open
zsozark opened this issue Apr 4, 2025 · 0 comments
Open

Flash of Light Theme in SSR with Dark Mode Since v2.14.3 #17953

zsozark opened this issue Apr 4, 2025 · 0 comments
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 mode/ssr Qv2 🔝 Quasar v2 issues

Comments

@zsozark
Copy link

zsozark commented Apr 4, 2025

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

https://stackblitz.com/edit/quasarframework-stackblitz-templates-yrptuszq?file=quasar.config.js,src%2FApp.vue&title=Quasar%20Framework%20-%20app-vite%20v2

How to reproduce?

  1. Open the reproduction URL provided above.
  2. Observe the initial page load in the browser preview.
  3. Notice that the page briefly shows the light theme (white background) before switching to the dark theme (dark background).

Alternatively, in the Quasar repo:

  1. Clone the Quasar repo and checkout v2.14.3 (git checkout v2.14.3).
  2. Navigate to ui/dev and install dependencies (npm install).
  3. Edit ui/dev/src/App.vue to enable dark mode:
        $q.dark.set(true);
  4. Run the SSR dev server: npm run dev:ssr.
  5. 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

@zsozark zsozark added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Apr 4, 2025
@github-actions github-actions bot added area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite mode/ssr labels Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 mode/ssr Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

1 participant