-
Notifications
You must be signed in to change notification settings - Fork 14
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 SSR styling of code-blocks #480
Conversation
🦋 Changeset detectedLatest commit: e561a28 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@rowanc1 I've just lifted the CSS from highlightjs directly into our styling. This means that we don't need to duplicate any nodes. Are you comfortable with this change? |
import light from 'react-syntax-highlighter/dist/esm/styles/hljs/xcode.js'; | ||
import dark from 'react-syntax-highlighter/dist/esm/styles/hljs/vs2015.js'; |
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.
🤮
Recent theme work moved theme logic entirely client-side1, so that we can support client-only theme configuration (
localStorage
).This PR vendors the current styles that we use from
highlight.js
, and adds selectors for the dark-mode variant. This means that we can set the theme entirely client-side.Closes #473
Footnotes
Technically SSR can render the proper state server-side, but for first-visits, we have to wait for the client to compute the proper state (and do some hydration-hacks to resolve the state). ↩