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

fix: move script to head and set forced color mode on <html> element #128

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

danielroe
Copy link
Collaborator

@danielroe danielroe commented Feb 21, 2022

Previously the script was located in the body, which means it wasn't being executed until after CSS, etc. in <head> downloads and is parsed. This can create a noticeable flash.

This PR moves the script into the head, which reduces or eliminates the flash. The only blocker was that we previously added a data attribute to <body> which we obviously can't manipulate if we are executing the script before we have that element; I've moved this to <html> instead.

@danielroe danielroe requested a review from atinux February 21, 2022 10:59
@danielroe danielroe self-assigned this Feb 21, 2022
@danielroe danielroe merged commit 273f07e into master Feb 21, 2022
@danielroe danielroe deleted the fix/flash branch February 21, 2022 11:14
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