openmultiplayer / web

The open.mp web services monorepo. Homepage, documentation, server index, and more! All in one place.

Home Page:https://open.mp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dark mode page flash

leonardssh opened this issue · comments

Current behavior

When dark mode is active, accessing a different route will flash the whole website, which is very disturbing to the eyes.

Expected behavior

The dark mode it should be applied globally, and remain set for the duration of the website navigation, regardless of the client's behaviour.

Solutions

Using ColorModeScript - no results

Chakra-UI it has a component built in that tries to solve this problem. - ColorModeScript

I tried, but no results, the issue still persists.

Using an external script - partial results

This solution may not be the cleanest and most accurate, but it can solve this problem, but there is still an issue related to body's background that cannot be manipulated so easily.


Color Mode Flash Issue - from chakra-ui docs

"In some cases, when you switch to dark mode and refresh the page, you might experience a quick flash of white mode before it switches correctly."

This issue exists and is known by the Chakra-UI team, probably a solution from them would be the most ideal.

I'll come back with updates if I discover anything.