I'm a huge proponent of dark color schemes! Aside from causing less eye strain due to emitting less blue light, dark pixels drain less battery life...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
Wouldn't it be easiest (and most widely supported) to just insert a bit of blocking javascript at the start of the page that optionally adds a class to the
<body>element?That would still cause a flicker as described above. The header would enable the server to generate the appropriate static content so there's no client-side blocking.
How so?
For the blocking javascript to run (via
<script>tag) the browser needs to load the HTML for the page. This HTML won't have a theme initially applied to it, so the page could switch from light to dark after this script runs.Yea but that's the point of the javascript block; apply the theme as the page is loading, how would that still cause any flickering?
The JS doesn't run until the page is loaded. Here's an example.
Safari uses webkit. Safari will get this header really close to the time it is released in webkit.