In comparison, the pure-CSS ideas that some people are posting would work automatically if your browser supports dark mode, and would enlarge the (cached with long ttl) CSS file only very slightly.
Pure CSS would be quite cool, but we'd probably also need a snippet of JS to add a button allowing to switch between light and dark mode. (There's probably a way to do it without JS that someone will hopefully comment too.)
A separate subdomain:
- Requires separate TLS certificates to be maintained.
- Doesn't play nice with caching.
- Doesn't play nice with password managers.
- Doesn't work with any existing links. Users would have to manually add the `dark` prefix.
- Is generally a bad user experience.
> Doesn't play nice with password managers.
Check your password manager settings. Most have options to match on domain, subdomain, port or have the ability to set equivalent domains either globally or per credential.