← All examples

CSS Look & feel news.ycombinator.com

Hacker News: dark mode

Swaps the bright background for a consistent dark theme that is gentler on the eyes at night.

Code to copy

/* A proper dark theme for the whole site */
html, body {
  background: #1a1a1a !important;
  color: #c8c8c8 !important;
}
#hnmain {
  background: #1f1f1f !important;
}
td, .comment, .commtext, .toptext, .default {
  color: #c8c8c8 !important;
}
.title .titleline a:link,
a:link, a:visited {
  color: #b9bfc6 !important;
}
.subtext, .comhead, .subtext a, .comhead a,
.rank, td.title {
  color: #8a8a8a !important;
}
.commtext a:link, .toptext a:link {
  color: #6ea8fe !important;
}
input, textarea {
  background: #2a2a2a !important;
  color: #e0e0e0 !important;
  border: 1px solid #444 !important;
}

How to use this example

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. Paste the code into the rule's CSS panel and save — the effect appears instantly.

Rate this example

No ratings yet — be the first.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases