-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Open
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executionexternalThis issue is caused by an external dependency and not Docusaurus.This issue is caused by an external dependency and not Docusaurus.
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
When loading a Docusaurus page in dark mode, code blocks briefly flash with light theme colours before switching to the correct dark theme colours. This creates a jarring visual experience.
Reproducible demo
Can reproduce on any official page, https://docusaurus.io/docs/configuration
Steps to reproduce
- Configure Docusaurus with both light and dark Prism themes.
prism: {
theme: prismThemes.oneLight,
darkTheme: prismThemes.oneDark,
},- Switch the site to dark mode
- Navigate to any page with code blocks
- Observe the code blocks during loading
Expected behavior
Code blocks should immediately display with the dark theme colours when the page loads in dark mode.
Actual behavior
Code blocks briefly display with light theme colours (a white background and light syntax highlighting), then quickly switch to dark theme colours. This flash is very noticeable and disrupts the user experience.
Your environment
N/A
Self-service
- I'd be willing to fix this bug myself.
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executionexternalThis issue is caused by an external dependency and not Docusaurus.This issue is caused by an external dependency and not Docusaurus.