This project is a Cloudflare Worker that acts as a proxy for Hacker News, injecting a dark mode CSS theme while keeping the site fully functional.
- Proxies Hacker News through Cloudflare Workers.
- Injects custom dark mode CSS.
- Fast, free, and serverless.
git clone https://github.com/vvainio/dark-hn.git
cd dark-hnWrangler is Cloudflare's CLI tool for managing Workers.
npm install -g wranglerUpdate wrangler.toml with your Cloudflare Account ID. You can find it by running:
wrangler whoamiThen, replace your-cloudflare-account-id in wrangler.toml:
name = "dark-hn"
type = "javascript"
account_id = "your-cloudflare-account-id"
workers_dev = true
compatibility_date = "2025-02-24"To test locally:
wrangler devTo deploy to Cloudflare:
wrangler publishOnce deployed, you'll get a URL like:
https://dark-hn.youraccount.workers.dev
Use this to browse Hacker News in dark mode.
The worker injects a set of CSS styles. These can be modified from ./src/index.ts.
MIT License. Feel free to use and modify.