-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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 FOUC of Prism Theme #7867
base: main
Are you sure you want to change the base?
Fix FOUC of Prism Theme #7867
Conversation
Build is failing because the code in this PR uses functionality from
|
@lex111 would appreciate your feedback/insight |
Great, looking forward to fix this prism FOUC issue ;) To make the review easier, what about publishing your prism changes on npm so that we can just use your temporary published package on this PR, this would help the review. Otherwise, I like the idea of using CSS variables. Wanted to do something similar myself, but in a more consistent way (ie get 100% rid of the inline styles, and always use CSS variables for all renders) |
Still a draft PR while I wait for this PR to get merged and I validate that it actually fixes the FOUC.
Pre-flight checklist
Motivation
Once this PR for prism-react-renderer is merged, we can solve the FOUC issue described in @lex111's PR here.
Test Plan
Test links
Deploy preview: // TODO
Related issues/PRs
How to reproduce FOUC
docusaurus
websitecd docusaurus yarn install yarn website:build:en yarn serve:website
Navigate to http://localhost:3000/docs/sidebar/autogenerated
Toggle to dark mode
Add breakpoint to top level
<html>
Refresh the page (with the chrome inspector open) and observe FOUC
How to reproduce FOCU fix
prism-react-renderer
and link itdocusaurus
, checkout my PR and link to local copy ofprism-react-renderer
Repeat steps 2-4 in the previous section
Refresh the page (with the chrome inspector open) and observe that styling is correct
Cleanup (unlink, reset origin)