-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
In Darkmode fix white flash on page refresh #5295
Comments
To address the white flash on page refresh when dark mode is selected, consider implementing a script in the main entry point of your application that checks the user's theme preference and sets the background color of the body element accordingly before the rest of the page loads. This can be done by modifying the For the front-end ( body[data-theme='dark'] {
background-color: #121212; /* Or any dark color matching the dark theme */
} And for the Chrome extension ( body[data-theme='dark'] {
background-color: #121212;
} To dynamically set the theme before the page is fully loaded, you can add a script in the HTML entry file ( <script>
if (window.localStorage.getItem('theme') === 'dark') {
document.body.setAttribute('data-theme', 'dark');
}
</script> This solution assumes the theme preference is stored and accessible. Adjust the script as necessary to match how your application stores and retrieves the user's theme preference. Referencestwentyhq/twenty/packages/twenty-front/src/index.css |
I guess this could probably fix it: #4914 |
Bug Description
Fix blank white page that flashes on refresh when user has dark mode selected.
Technical inputs
Confirmed on
The text was updated successfully, but these errors were encountered: