Skip to content

Bug: Dark mode users see a white flash on page load #91

@rahul-rajak-nsut

Description

@rahul-rajak-nsut

Summary

Dark mode users experience a white flash during initial page load because the theme is applied only after hydration completes.

Contexts

The current theme initialization runs after the page has already rendered once, causing the browser to briefly display light mode before switching to dark mode.

This behavior is noticeable during hard refreshes and slower page loads, especially when dark mode is stored in localStorage or inferred from system preferences.

Tasks

  • Investigate the current theme initialization flow
  • Ensure the correct theme is applied before first paint
  • Verify dark mode persists correctly across refreshes
  • Confirm no regression in light mode behavior

Acceptance Criteria

  • No visible white flash during initial load in dark mode
  • Works correctly with both saved preferences and system theme settings
  • Existing functionality remains unaffected
  • Tests/docs updated if required

Area

web

Difficulty

Easy to Intermediate — requires understanding of theme initialization and hydration timing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions