Comment by ochoseis
5 years ago
For the sake of simplicity, could we just serve up a subdomain darknews.ycombinator.com, same content, just different stylesheet?
5 years ago
For the sake of simplicity, could we just serve up a subdomain darknews.ycombinator.com, same content, just different stylesheet?
When you click on a link to the news.ycombinator.com domain, what should happen if you prefer dark mode? And vice versa?
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.
Unfortunately, there are some of us who also like the solarized type light mode in HN more than dark mode, but we use dark mode at the system level because the OS light mode is awful.
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.)
They could put a preference in the profile page. But I think that switching the theme would be the browser's job.
By using CSS variables, only a few lines of JS are needed- small enough that they can be inlined in the HTML.
I don’t think you’ve properly considered what a terrible idea this is.
Please explain as I am curious
Adding dark mode CSS adds a few hundred bytes, maybe a couple kb at most to the site.
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.
1 reply →
That's not simple at all..
Tagline: "Come to the dark site."