hn.today

Minimal dark mode styles for Hacker News

antonz.org71 points61 comments
Screenshot of Minimal dark mode styles for Hacker News

Hacker News has no built-in dark mode, so the practical workaround is to apply custom CSS through a browser extension such as Stylus or a userscript manager. Alternative frontends can be slow and may not support logging in, while routing HN through a proxy to inject styles takes more effort and risks rate limits or bans. For a site with HN’s simple styling, a small CSS rule is presented as a more straightforward option.

The rule runs only when the device prefers a dark appearance. It inverts the page’s colors, then rotates hues by 180 degrees to largely preserve the original colors while turning light backgrounds dark; a white base background becomes black under the filter. This approach can be used on other sites, but complicated designs may look poor, and images are inverted too. HN’s basic styling makes those drawbacks manageable. A second optional rule enlarges the page on screens at least 992 pixels wide, using 1.25× zoom - or even 1.5× - to offset the site’s fixed-width layout and small text.

Read on antonz.org61 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

Are EU Kidding Me?

Are EU Kidding Me?

A legal scholar argues that the EU’s proposed Kids Act is poorly drafted, with conflicting rules and broad language that could sweep in unrelated services and restrict products such as voice assistants. He urges the European Commission to withdraw the proposal and rewrite it with clearer, workable requirements. (michae.lv)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.