Live data from Hacker News

Ask HN: Dark mode for HN please?

news.ycombinator.com

41–50 of 469 posts

Re: Ask HN: Dark mode for HN please?

#42
post #34
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…

Would it be an idea to open a github repo for this and let the community contribute their efforts there?

Looking forward to the pull request finally modernising HN into a React SPA

Re: Ask HN: Dark mode for HN please?

#43
post #38
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…

This commenter linked their own custom stylesheets that they've already been using: https://news.ycombinator.com/item?id=23198500 I haven't inspected their quality or thoroughness myself, but it seemed like a certain amount of that was implied

Ah, I'm glad you mentioned that; I took a look at it earlier, but I think what would be most helpful is just the most minimal set of CSS we could put in curly braces after prefers-color-scheme: dark. In other words, a patch to https://news.ycombinator.com/news.css that would strictly only add lines—and preferably the most minimal that would do the trick.

Re: Ask HN: Dark mode for HN please?

#45
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…

Right now, the profile has a single property "topcolor" where you can slightly customize HN. It seems that this could easily be extended with a few more similar properties, suitable values of which could produce a darkmode.

Re: Ask HN: Dark mode for HN please?

#46
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.commtext { color: #fff; }
    a.storylink:visited { color: #444444; }
  `;
  targetElement.appendChild(style);
};

(function main() { const { ...attributes } = getAttributes(); changeStyles(attributes.head); })();

Re: Ask HN: Dark mode for HN please?

#47
I have to disagree that dark mode should the default.

It'd be fine to offer that as an option, but I'm not really seeing any reason at all why that should be default and I recall a few posts here where quite a few other's expressed they were not fans of dark mode themes.

To be fair, I never browse this or most any other web site on a phone, so, maybe apply that to phones only if that's an option.

Re: Ask HN: Dark mode for HN please?

#48
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'll check this thread but also feel free to email me zain@yc for more feedback - just add [HN FEEDBACK] in the subject :-)

don't worry, we'll make sure we don't pull a reddit on you ;)

Re: Ask HN: Dark mode for HN please?

#49
post #43
post #38

Earlier quoted context omitted.

This commenter linked their own custom stylesheets that they've already been using: https://news.ycombinator.com/item?id=23198500 I haven't inspected their quality or thoroughness myself, but it seemed like a certain amount of that was implied

Ah, I'm glad you mentioned that; I took a look at it earlier, but I think what would be most helpful is just the most minimal set of CSS we could put in curly braces after prefers-color-scheme: dark . In other words, a patch to https://news.ycombinator.com/news.css that would strictly only add lines—and preferably the most minimal that would do the trick.

For sure. I can try and whip something up later tonight if no other solution presents itself before then. I can email it or post here.

Re: Ask HN: Dark mode for HN please?

#50
post #17
post #11

Here's my own dark theme userstyle for HN, with the colors from Firefox's dev tools. For news.ycombinator.com - https://pastebin.com/K1KS64KR For hn.algolia.com (the search form) - https://pastebin.com/ksH6QcV4

The problem is most browsers don't have an easy way to add custom styles any more. Desktop Safari does, surprisingly, and I use it there. Firefox removed that feature. There are extensions, but browser extensions are a massive security hole so I don't use any that aren't too-big-to-be-corrupted.

Firefox didn't remove it. They just put it behind a new flag that is default off. Apparently it was because it affects performance for those not using the feature.
Post reply on HN