#Preventing white flash
1 messages · Page 1 of 1 (latest)
I think you're referring to a FOUC, which is quite difficult to overcome. If the user has set their OS theme to light a webpage will by default be white, which will cause a flash. There's not much to do there, apart from setting the theme as fast as possible, which probably means not setting it when the Vue app mounts, but earlier
which probably means not setting it when the Vue app mounts, but earlier
Exactly this - the approach I use usually is to keep the selected theme in thelocalStorage, and add a blocking script in the Blade template directly to apply a class onbodydepending on the user preferences