3 ms·
The problem is that the question of whether dark mode CSS should be applied is only known once JavaScript can be executed on the page.
by saagarjha 7y ago
The problem is that the question of whether dark mode CSS should be applied is only known once JavaScript can be executed on the page.
- deleted 7y ago[deleted]
- darepublic 7y agoThat's the thing with SSR... (i.e. with Next) or with pre-rendering apps before hand. In the initial GET request to the page, you also send a cookie with user preference. Depending on their dark mode preference you can style the page to be in dark mode as part of the server or pre-rendered markup -- no JS required :o. Now.. how difficult that is to do with Gatsby I don't know. But the fact that someone shot themselves in the foot with Gatsby, then learned to hobble along on one foot isn't a cause for celebration imo.
- saagarjha 7y agoI don't see how you could do that with a static site.