Skip to content

Remove the dark class from the HTML element #101

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sertxudev
Copy link
Contributor

The dark class causes Flux to flash to dark while loading the page.

@joshhanley pointed this out in this comment livewire/flux#1501 (comment) :

@mute92 ah! I've seen this before. For some reason, the starter kits have class="dark" hard coded on the HTML element in the layout. But that causes the flash.

<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="dark">

Remove that and it should stop the flash and let Flux manage it properly.

@Webotvorba
Copy link

@sertxudev just have the same issue I have changed the templates but now when I choose dark theme it flashes from light to dark.

@sertxudev
Copy link
Contributor Author

That's something I didn't expect! I'm usually on light theme so I didn't have a chance to notice it.
Maybe Flux takes some time to add the dark class to the HTML which could make it flash.

Idk if @joshhanley or @calebporzio can give us some ideas to solve this.

@Webotvorba
Copy link

@sertxudev this seems to appear only on Forge apps. When I removed the class=dark on localhost (Herd) it works without the flashes. I have posted comment on the previous issue under flux repo

@sertxudev
Copy link
Contributor Author

I use Herd on Windows and I have my own K8s cluster, so can try it without Forge. Thanks for the info!
I will post the results when I test it out.

@taylorotwell taylorotwell marked this pull request as draft July 4, 2025 11:57
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 this pull request may close these issues.

2 participants