Live data from Hacker News

Ask HN: Dark mode for HN please?

news.ycombinator.com

171–180 of 469 posts

Re: Ask HN: Dark mode for HN please?

#171

Earlier quoted context omitted.

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.

Re: Ask HN: Dark mode for HN please?

#173
post #32

Ok, you guys, this isn't the first time we've heard this request ( https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que... ). I'm willing to do it (edit: not to change the default! just to add the option). It's just that any CSS issue that goes more than a quarter-inch deep is outside both my expertise and my interest. We can add CSS to https://news.ycombinator.com/news.css for prefers-color-scheme: dark , bu…

I have some styles I use. Screenshots:

https://imgur.com/a/WZAaJST

I don't love when dark modes skew blue, so tried to keep it neutral with blacks and greys

``` @media (prefers-color-scheme:dark) { body { background-color: #2a2b2e; } #hnmain { background-color: rgb(32, 33, 36); }

  a:link, .hnmore a:link, a:visited, td, .c00, .c00 a:link {
    color: #e8eaed;
  }
  .subtext, .comhead a:link, .subtext a:visited, span.subtext a:link, .subtext a:visited {
    color: #9aa0a6;
  }
} ```

Re: Ask HN: Dark mode for HN please?

#175
post #174

I don't get the appeal of dark mode. Do people really like to pretend that they're on a submarine or something?

Some people use it because they have migraines and bright lights trigger their headaches.

Some people use it for "stealth" reasons when they want to be online without giving off a lot of light for some reason.

Some people are photophobic -- aka light sensitive -- and just favor darker websites generally.

There's myriad reasons to want to use dark mode. It's not any one thing.

Re: Ask HN: Dark mode for HN please?

#176
post #99

Earlier quoted context omitted.

Please, for God's sake, don't screw it up. I can keep up with news on this site from a 15 kb/s shared satellite link when I'm out at sea. Except perhaps for the really big threads. I love the simple interface. It's text, it's simple, it's readable, and when I hit the spacebar, it scrolls down a page. No fancy fonts, no javascript, no nothing. I love HN for its simplicity and speed. Thanks for maintaining a good engin…

Well, if we want HN to follow best modern web practices, I recommend rewriting the whole thing with React/Node.js using TypeScript. Then, we can get a proper CSS framework in place like Material that will really allow us to get everything looking really good. I can design a cool looking loading screen that says "HN" while the JS is loading in the background.

I think it should be Vue, what with the patents-clause with React and everything

Re: Ask HN: Dark mode for HN please?

#177
post #70

Earlier quoted context omitted.

minimal CSS to add (nothing to remove): https://pastebin.com/4JYbSi5F [edit]: fixed, shorter version: https://pastebin.com/dT4KKt3s [edit 2: fixed textarea, dead links: https://pastebin.com/CKy4HQXE ] [edit 3: added a screenshot: https://imgur.com/a/Ont553x ]

I wonder if removing the whitespace on the original, while adding this, would give us a net filesize modification of 0

Most likely! Then again, modern CSS is pretty awesome. Not flawless, but so much better than 10 years ago.

Re: Ask HN: Dark mode for HN please?

#178

This is code for an extension I run locally. const getAttributes = () => { let head = document.head || document.getElementsByTagName("head")[0]; return { head, }; }; const changeStyles = (targetElement) => { style = document.createElement("style"); // set style.innerHTML to darker colors, append to head style.type = "text/css"; style.innerHTML = ` body, #hnmain { background: #272822; } a.storylink, a.morelink, span.c…

NOOOO! Why not a check box in the profile page? There is already a place for changing the colors. Can we please not add any javascript? The server remembers my topbar color. It can remember a boolean flag too.

I think he shared this in case others want to use this to update their hn theme locally, not for hn to implement this...

Re: Ask HN: Dark mode for HN please?

#179
post #32

Ok, you guys, this isn't the first time we've heard this request ( https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que... ). I'm willing to do it (edit: not to change the default! just to add the option). It's just that any CSS issue that goes more than a quarter-inch deep is outside both my expertise and my interest. We can add CSS to https://news.ycombinator.com/news.css for prefers-color-scheme: dark , bu…

@media (prefers-color-scheme:dark){body{filter:invert(1) hue-rotate(180deg)}} One-liner inverts the brightness and preserves the orange.

Unfortunately the colors are a bit too bright for the dark page.

Re: Ask HN: Dark mode for HN please?

#180

Earlier quoted context omitted.

Anyone who wants to make a suggestion is welcome to. I'm not a programmer, so I'm probably saying something incredibly, fantastically stupid. Take this in the spirit of "Brainstorming" where you say even the stupid stuff because that sometimes leads to good things. I am not a programmer, but I do know some HTML and CSS and studied it a bit and Blogger (aka Blogspot) let's you dig in the code of the theme if you want,…

I don't think it's a good idea for HN to add this (a lot of work and potential downsides, for minimal returns), however you can do it using this extension! https://chrome.google.com/webstore/detail/witchcraft-jscss-i... I use it for a bunch of minor HN mods already, and it's great :)

Extensions do not really work on mobile, unless you go out of your way to find something that supports them.
Post reply on HN