White flash on page refresh #654

Closed
opened 2026-04-29 13:05:32 +00:00 by b23albst · 8 comments
Collaborator

When refreshing the page, there is a quick flash of white, most noticeable when using dark mode. This needs to be fixed

When refreshing the page, there is a quick flash of white, most noticeable when using dark mode. This needs to be fixed
Collaborator

This issue needs more information. Browser? Operating system? Device? Is the browser in dark/light mode?

This issue needs more information. Browser? Operating system? Device? Is the browser in dark/light mode?
Author
Collaborator

Oh, sorry. After testing having tested on different devices, I noticed the issue when using firefox on ubuntu and firefox and edge on windows. I could not see the flash when using chrome on ubuntu. The browser was in dark mode for all tests.

Oh, sorry. After testing having tested on different devices, I noticed the issue when using firefox on ubuntu and firefox and edge on windows. I could not see the flash when using chrome on ubuntu. The browser was in dark mode for all tests.
Collaborator

Directly (like "directly-when-pressing-the-button" directly) after hitting refresh? Can it be that the page is loading in and the CSS hasn't loaded in yet? I imagine that a webpage loads the HTML structure first, then applies CSS. Then the bright flash might be the body defaulting to white.

Directly (like "directly-when-pressing-the-button" directly) after hitting refresh? Can it be that the page is loading in and the CSS hasn't loaded in yet? I imagine that a webpage loads the HTML structure first, then applies CSS. Then the bright flash might be the body defaulting to white.
Author
Collaborator

Yeah, I suspect this is the problem

Yeah, I suspect this is the problem
Collaborator

A white flash is usually a rendering + CSS timing problem, sometimes influenced by the browser. The browser paints the page before CSS/theme styles are fully applied, which is what you guys suspected.

Firefox tends to paint earlier which causes a more visible flash while Chromium (Chrome/Edge) may delay paint slightly. I only got the problem on firefox when I tested, and fixed the white flash's color by fixing a reference to the theme.css that was broken (it now flashes the chosen themes bg color). But I do not think it will be possible to fix the whole flashing issue. The login modal also uses a different colored background which will make it more apparent when reloading.

What professionals do to avoid flashing light: split up the rendering into two stages, the necessary (background, theme, layout) and the secondary (other components), renders a skeleton first before the actual stuff (skeleton components) and sets rules to prevent performance issues. Maybe some rules should be set here to keep the performance low?

A white flash is usually a rendering + CSS timing problem, sometimes influenced by the browser. The browser paints the page before CSS/theme styles are fully applied, which is what you guys suspected. Firefox tends to paint earlier which causes a more visible flash while Chromium (Chrome/Edge) may delay paint slightly. I only got the problem on firefox when I tested, and fixed the white flash's color by fixing a reference to the theme.css that was broken (it now flashes the chosen themes bg color). But I do not think it will be possible to fix the whole flashing issue. The login modal also uses a different colored background which will make it more apparent when reloading. What professionals do to avoid flashing light: split up the rendering into two stages, the necessary (background, theme, layout) and the secondary (other components), renders a skeleton first before the actual stuff (skeleton components) and sets rules to prevent performance issues. Maybe some rules should be set here to keep the performance low?
Collaborator

@b24idalu I think you can write an issue for this for what you have researched. Otherwise if that is complicated one method is to have an simple text informing the customer that the page is loading with text information then we can show the page after 2s delays.

When the issue is created I can close this issue.

@b24idalu I think you can write an issue for this for what you have researched. Otherwise if that is complicated one method is to have an simple text informing the customer that the page is loading with text information then we can show the page after 2s delays. When the issue is created I can close this issue.
Collaborator

I am currently creating a skeleton for the issue, that should be able to cover the flash. Will create a PR when it is done.

I am currently creating a skeleton for the issue, that should be able to cover the flash. Will create a PR when it is done.
Collaborator

the pr is merged I close this issue.

the pr is merged I close this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K#654
No description provided.