Render Flow - Class-based dark mode strategy
Load HTML
Load Tailwind CSS
Check for 'dark' class on <html> or <body>
Apply dark mode styles if 'dark' class present
Render page with dark colors
If 'dark' class removed, revert to light styles
The browser loads the HTML and Tailwind CSS. It looks for the 'dark' class on a parent element. If found, it applies dark mode styles defined with the 'dark:' prefix. This toggles colors and backgrounds for dark mode.