designTailwind
Respect Color Scheme Preference
MUST
MUST: Apply dark class in inline <head> script before first paint to prevent theme flash
Initialize theme from prefers-color-scheme before page renders
Bad
Good
Why it matters
If you wait for JavaScript to run before checking the color scheme, users see a flash of the wrong theme (FART). Inline a script in <head> that runs synchronously before render.
References