Skip to content

[Bug]: Dark mode flickers to light mode for a split second on every page navigation #558

@Priyanka0205-CSE

Description

@Priyanka0205-CSE

Bug Description

Hey, found something that's been bugging me for a while now.

I have dark mode enabled and every time I navigate between pages (like going from Leaderboard to Profile or Friends) the page briefly flashes white before settling back to dark mode. It's really noticeable especially at night and honestly quite jarring.

Feels like the theme isn't being applied before the page renders. Maybe the ThemeContext is initializing with a default light value before reading from localStorage?

Steps to reproduce:

  1. Enable dark mode
  2. Navigate between any two pages using the sidebar
  3. Watch for a white flash during the transition

Expected: Theme should stay consistent during navigation with zero flicker
Device: Windows 11, Chrome 124

Metadata

Metadata

Assignees

Labels

NSoC'26NSoC 2026bugSomething isn't workingfrontendFrontend related changes (HTML/CSS/JS/React)gssocGirlScript Summer of Codegssoc26GirlScript Summer of Code 2026needs-reviewIssue needs reviewneeds-triagensocNSoC

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions