The Perfect Dark Mode
TLDRThe dreaded flicker of light mode is a problem that is not limited to static/hybrid websites but extends to pretty much any website that uses JavaScript to "hydrate" its components. We need to find a way to be able to run some code and apply the appropriate background-color (and by extension, the theme) before the entire page has loaded.
Table of contents
The ProblemThe SolutionStoring (and retrieving) user preferenceSystem-wide preferenceBack to BasicsNext.js' DocumentDangerously set whaa?IIFEsCSS Variables3 Comments
Sort: