-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Replace the <link> without flashing the css #257
Conversation
✅ Deploy Preview for anchor-position-wpt canceled.
|
✅ Deploy Preview for anchor-polyfill ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think this makes sense. Thanks for this! The momentary double styles will be less impactful than momentary no styles.
The only change I see is with the tests, which I think will be easy to fix- it looks like since both link
s are in the DOM, querySelector
selects the old one, so the load
event is called on the wrong element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That change fixed the tests. Thanks for this contribution!
This fixes the flash of unstyled content (FOUC) by inserting the new stylesheet before the old one is removed.