Readit News logoReadit News
Posted by u/jaylittle 3 years ago
Hacker News needs a Dark Mode
Hackers like dark modes. Hacker News therefore should provide its users with a dark mode option. Maybe even automatically select it based on their browser preferences.

Note: Telling me to load up some browser extension to handle it is a bit silly as it requires me to implicitly trust the author of said extension which will see and have access to virtually everything on every website I enable it for.

All thoughts and criticisms of this statement are welcomed.

Viva la Dark Mode!

andreynering · 3 years ago
I know you mentioned you don't like extensions, but for those that don't mind Dark Reader is really useful:

https://darkreader.org/

I have it setup to enable according to the system. Also, I use the whitelist mode, so I enable on specific websites instead of having it enabled for every one automatically.

It's available on mobile via Firefox for Android!

basch · 3 years ago
for anyone trying this for a first time, after installing, click the icon, click more, and there are 4 ways to darkmode a site. filter, filter+, static, dynamic. youll find different ones work better for different sites. then go back to the filter tab and modify brightness and contrast. sometimes the filtermode that is not immediately the best looking "works" the best once fixing the contrast.

i prefer hc.yc and hckrnews.com in static.

andreynering · 3 years ago
Good tips!
utucuro · 3 years ago
Darkreader seems to always induce a noticeable performance hit on each computer I've ran it on for some reason when I run it with the default settings. I may try your whitelist method instead and give it another chance...
knudude · 3 years ago
Thank you for your suggestion! I am currently using it now & it's fantastic!
cuttysnark · 3 years ago
If you're using ublock origin, I have these filters which I copied from another HN comment once upon a time.

news.ycombinator.com##html:style(filter:invert(100%) hue-rotate(180deg))

news.ycombinator.com##body:style(background: white)

news.ycombinator.com##div.toptext:style(color: black)

news.ycombinator.com###hnmain td[bgcolor="#000000"]

edit: "rules" -> "filters"

BackBlast · 3 years ago
That rule set is pretty harsh. Can I recommend:

  news.ycombinator.com##body:style(background: black)
  news.ycombinator.com##td:style(color: #fafafa !important)
  news.ycombinator.com##table:style(background-color: #120F0D)
  news.ycombinator.com##div.toptext:style(color: #fafafa)
  news.ycombinator.com##span.c00:style(color: #fafafa !important)
  news.ycombinator.com##a:style(color: #ffa000 !important)
  news.ycombinator.com##span#karma:style(color: #faa000 !important)
  news.ycombinator.com##span.pagetop:style(color: #fafafa !important)
  news.ycombinator.com##textarea:style(color: #fafafa !important; background: inherit; )
  news.ycombinator.com###hnmain:style(background: #120F0D !important)

calebj0seph · 3 years ago
Here's a dark mode stylesheet for Hacker News that I've been maintaining for a while as well: https://userstyles.world/style/1898/hacker-news-dynamic-dark

Just need the Stylus extension for your browser.

I've gone through every different feature on HN to tweak the colors, including details like down voted comment colors and obscure things like the special colors at Christmas.

swifthesitation · 3 years ago
Oh wow, thank you for sharing; this is lovely!
jmholla · 3 years ago
Note: These actually go under the filters tab of uBlock Origin, not the rules tab.
SV_BubbleTime · 3 years ago
I’m an embedded dev, so websites and web tech are a black box to me… I’ve never asked, does the ## mean “overwrite” as uBlock DSL?
umvi · 3 years ago
> I’m an embedded dev, so websites and web tech are a black box to me

You should start tinkering with embedded webservers then (civetweb, etc)! Even embedded devs should learn web tech because often browsers are the easiest way to interface with router/modem settings, IoT settings, etc.

In this case "##" is uBlock filter syntax. Basically "news.ycombinator.com##html:style(filter:invert(100%) hue-rotate(180deg))" means "if the host matches news.ycombinator.com inject the following CSS"

Here's the docs if you want to rtfm: https://github.com/gorhill/uBlock/wiki/Dashboard:-My-filters

In this case I believe we are dealing with "cosmetic filters": https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-f...

onetom · 3 years ago
i didn't know ublock can be used as a poor man's violent monkey :)

i can't read dark mode as well as light mode, but thanks for the advice!

ksec · 3 years ago
https://news.ycombinator.com/item?id=23197966

And probably a dozens more with 100+ comments and hundreds more with a few comments.

At this point I have simply given up.

jaylittle · 3 years ago
That's actually very helpful, thank you for that.

I'm going to work on implementing the CSS changes when I get bored. If that's the only thing standing between a bunch of hackers and dark mode on the hacker news website, I'm going to be very disappointed ;)

als0 · 3 years ago
Same. It's been 3 years since they said they would do something and it only needs a couple of lines to the CSS.
danielvaughn · 3 years ago
eh to be fair it's a bit more than a couple of lines, but I agree, with a site like HN it shouldn't be too bad.
jaylittle · 3 years ago
Okay I'm a glutton for punishment so I added support to news.css and created a patch for it.

https://news.ycombinator.com/item?id=36344178

baq · 3 years ago
Never understood the point of dark modes. Am I too old?
Solvency · 3 years ago
I like to read HN in the evening to unwind.

A bright white website after dark is a great way to disrupt your melatonin production and affect your ability to fall to sleep.

Dimming your phone brightness does not help sufficiently at all. In a dark room it's still like a relative flashlight in your eyes.

This should not be such a head scratcher to understand.

ghusto · 3 years ago
> A bright white website after dark is a great way to disrupt your melatonin production and affect your ability to fall to sleep.

I don't think that's true: https://time.com/5752454/blue-light-sleep/

This is a pet peeve of mine precisely because of the first line in that article:

> It’s become a virtually unchallenged piece of conventional wisdom that exposure to blue light—the type emitted by electronic device screens—is bad for sleep.

ghusto · 3 years ago
You are too old to fall for bullshit.

The argument is that dark mode is needed to tackle the problem of blue light messing with your melatonin. However, this has not only never been proven, there are studies to the contrary:

https://time.com/5752454/blue-light-sleep/

Moreover, dark mode hurts my eyes and does the opposite of the other purported benefit.

Screens induce anxiety after long periods of usage, and it has nothing to do with the colour of the light. If you're reading your phone in bed before sleep, you have bigger problems.

Veen · 3 years ago
I think it's largely a matter of taste, although there are people for whom bright interfaces cause accessibility issues.

Personally, I can't stand light-on-dark interfaces and turn them off wherever I can, although that may be because I have an astigmatism and dark interfaces supposedly cause problems (although I'm not convinced that's the reason in my case).

andreynering · 3 years ago
It's easier to your eyes at night or cloudy days.

I have my devices setup to switch automatically by hour of day. Sometimes I switch manually when I want to.

CharlesW · 3 years ago
No. The primary benefit of "dark mode" is that it reduces eye strain for folks using their monitor at a brightness set too high for their environment. It can also just look cool, which is fine too.

Dark mode myths are summarized here: https://www.wired.co.uk/article/dark-mode-chrome-android-ios...

UI_at_80x24 · 3 years ago
>using their monitor at a brightness set too high for their environment

That's rather dismissive and ablest. I need high contrast. Dark background and bright text allow me to view the content. Screen brightness plays a role here too, but it's used to enhance the contrast, not compete against it.

dunham · 3 years ago
I could go either way, but switching back and forth is hard on me, so I tend to go light because the web is light. (Also because a lot of dark mode stuff tends to be crazy low contrast.)

I do however use dark mode when reading in bed and wish there was a pdf reader that did it.

TheLoafOfBread · 3 years ago
Or... you could just switch lights on in your room and brightness of your monitor compared to the rest of your environment won't be that dramatical.
basch · 3 years ago
white backgrounds can be very hard to use or distracting to people with floaters in their eyes. dark mode makes concentration possible.
a_c · 3 years ago
I understand the appeal of dark mode - to reduce eye strain, especially in dim environment. I suggest to not read your screen at all in the bedroom. It is the best down time for one's mind. Maybe I have undiagnosed eye problem. If the dark mode has a strong contrast with text, I see shadow/aura for minutes. It doesn't happen if the contrast is reduced nor in non-dark mode. I wonder if anyone has similar problem?
ghusto · 3 years ago
I have the same, and agreed on the advice of not using screens when you're trying to unwind.
mnd999 · 3 years ago
No, I never understood the point either. But then I learned to code on a ZX Spectrum where everything was light mode so maybe that’s it.
Eric_WVGG · 3 years ago
A computer LCD is effectively a flashlight shining in your face. If you read in bed every night, it's jarring and annoying.
bookofjoe · 3 years ago
"No screens in the bedroom" is a quick and dirty way to improve insomnia.
onetom · 3 years ago
the older i was getting the more i noticed that i can read light mode better than dark mode.

one day, when i was about 42 years old, sitting on a ferry on a very sunny day, i could hardly see my MacBook screen. switched to light mode and while the image was still a bit faint, it became totally readable.

I'm not using anything in dark mode ever since.

kagevf · 3 years ago
Maybe not old enough? ;-)

I use to prefer light mode exclusively, but my eyes feel more comfortable with dark mode as I get older.

JohnFen · 3 years ago
I'm a graybeard, but I find dark modes to be much more difficult to read than light ones. I've never really understood the appeal of dark modes (outside of just aesthetics), but I do understand that they have an appeal to some.
mikewarot · 3 years ago
When you get older, and cataracts are a thing... white backgrounds blur and essentially "fill in" dark text, drastically lowering the perceived contrast ratio, and this makes it very hard to read.

The inverse is much easier to read for me.

onemoresoop · 3 years ago
No, maybe it's your eyes that are okay with non-darkmode. I am not using darkmode by reducing by using nightmode all the time but darkmode is totally a fine way to spend time in front of the computer if that makes you comfortable.
mid-kid · 3 years ago
It's a way to forgo real customizability by limiting user choice to two colors.
anonzzzies · 3 years ago
Same. I am probably too old too, but it really doesn’t help me with anything…
mk67 · 3 years ago
I'm seeing a lot of visual snow with bright backgrounds, which is very annoying. Makes it close to impossible to focus.
jaylittle · 3 years ago
Thank you all for your enthusiastic responses!

I was sorry to learn that this feature request hasn't seen much traction. However @ksec gave me an idea by linking me to an earlier thread on this very same topic in which somebody suggested that we just create a patch for the existing news.css file.

Not sure why this thread got flagged, but I took it upon myself to create a patch for the existing news.css file as well as producing a new news.css file with dark mode support:

Patch: https://pastebin.com/Gwq5WSwX

Full File Pre-Patched: https://pastebin.com/Nd7JDLLT

Again, all thoughts and criticisms of this work will be welcomed.

Please help those of us with a dark mode preference enjoy this website more by implementing these changes (after a proper code review of course, as I would expect nothing less from fellow hackers)

Deleted Comment

crazygringo · 3 years ago
Note: extensions don't help for those of us on mobile browsers that don't support extensions.

And dark mode is most important/applicable when browsing on your phone before bed.

Ideally HN would just follow the user's dark mode OS-wide setting.

gabrielsroka · 3 years ago
I use the Chrome and Brave browsers on Android. Both support dark mode just fine. And it's automatic for every website, the site itself doesn't need to support it.

Are you on iOS?

ajdude · 3 years ago
I came here to mention this. I access HN via my rss feed on my iPhone and it's always a bit jarring contrasting with the rest of my themes.
ghusto · 3 years ago
> Note: Telling me to load up some browser extension to handle it is a bit silly as it requires me to implicitly trust the author of said extension which will see and have access to virtually everything on every website I enable it for

If the extension asks for permissions to all websites instead of just this one, then yes.

Also, "hackers" fix things like this themselves.

Also also, I may be reacting strongly to this because I don't like dark mode, or the assumption that I should because I'm a "hacker".

jaylittle · 3 years ago
A proper CSS implementation of this would respect your browser preferences, so everybody could have it work as they'd like ;)

I apologize for the implication, it was not on purpose.