Skip to content

Conversation

@jesseaborden
Copy link
Contributor

Motivation:

When a user refreshes the page in dark mode, the light styles flash before being set to dark.

Modifications:

I moved the function call to set the theme from the DOMContentLoaded event to directly after the opening body tag. This avoids loading the light styles before the data attribute is set.

Result:

Light styles no longer flash on load in dark mode.

@shahmishal shahmishal merged commit c5a4976 into swiftlang:main Jun 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants