Skip to content

Instantly share code, notes, and snippets.

@alex-jitbit
Last active August 5, 2025 21:31
Show Gist options
  • Save alex-jitbit/a3d57d97003d33295e430cc2b3b134fa to your computer and use it in GitHub Desktop.
Save alex-jitbit/a3d57d97003d33295e430cc2b3b134fa to your computer and use it in GitHub Desktop.
Dark Theme for Hacker News via uBlock Origin

Dark Theme for Hacker News

With a tiny uBlock Origin hack

If you have uBlock Origin go to uBlock's settings, open "My filters" and paste this code:

news.ycombinator.com##body:style(background: #222)
news.ycombinator.com##td:style(color: #ddd !important)
news.ycombinator.com##table:style(background-color: #222)
news.ycombinator.com##div.toptext:style(color: #ddd)
news.ycombinator.com##div.c00:style(color: #ddd !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: #ddd !important)
news.ycombinator.com##textarea:style(color: #ddd !important; background: inherit; )
news.ycombinator.com###hnmain:style(background: #222 !important)

Edit the colors if you want

If you're using Brave browser

Go to brave://adblock and - same

In other chormium browsers

  1. Enable local overrides (if not enabled)
  2. Open DevTools → Sources tab.
  3. In the Overrides tab (left sidebar), click "Enable Local Overrides".
  4. Choose a folder on your computer to save overrides.
  5. Edit the css file and paste this to the top. When you modify a file (like CSS), it will be saved locally and injected when you reload the page.
  6. Paste this at the top of news.css file
body {background: #222}
td {color: #ddd !important}
table {background-color: #222}
div.toptext{color: #ddd}
div.c00{color: #ddd !important}
a {color: #ffa000 !important}
span.karma{color: #faa000 !important}
span.pagetop{color: #ddd !important}
textarea {color: #ddd !important; background: inherit; }
#hnmain {background: #222 !important}

Now every time you open a HN page you would have to press F12 twop times to open devtools (to load overrrides will load)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment