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

Furo: pages flash black briefly on load #436

Closed
coruscating opened this issue Jun 30, 2023 · 2 comments · Fixed by #437
Closed

Furo: pages flash black briefly on load #436

coruscating opened this issue Jun 30, 2023 · 2 comments · Fixed by #437
Assignees
Milestone

Comments

@coruscating
Copy link
Collaborator

On my setup (Mac + Chrome), pages are rendered with a black background briefly before they fully load. Here's an example timeline recorded with the Performance tool, which shows that the page loads the black background first with light top and sidebars, and then the main content is populated in dark mode, then the whole page changes to light mode when the DOM fully loads some 300+ ms later.

image
@coruscating
Copy link
Collaborator Author

In particular, this happens when Chrome is in dark mode.

@Eric-Arellano
Copy link
Collaborator

Interesting. This is because it is starting in dark mode! Then we override it here:

<script>
{#- Force light mode. -#}
document.addEventListener("DOMContentLoaded", function () {
document.body.setAttribute("data-theme", "light");
});
</script>

I can play around with this. I'm not sure it's fixable, but hopefully. Thanks for the report! This is great polish. 💅

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 a pull request may close this issue.

2 participants