A beautiful, accessible dark mode extension for hckrnews.com with 13 customizable themes, WCAG-compliant colors, and instant toggling!
- 13 Premium Themes - Choose from carefully curated code editor-inspired color schemes
- WCAG AA Compliant - All themes meet accessibility standards with proper contrast ratios
- Instant Toggle - Switch dark mode on/off via popup or in-page button
- Auto-Refresh - Automatically refresh the page at customizable intervals (5-3600 seconds)
- Persistent Settings - Your theme, mode preference, and refresh settings saved across sessions
- Clean Navigation - Subtle, modern styling for navigation links (top 10, top 20, etc.)
- Lightweight & Fast - No tracking, no analytics, no nonsense
- Open Source - Fully customizable and transparent
- Default - Clean blue accents with balanced contrast
- Solarized Dark - Classic precision color scheme
- Tomorrow Night - Soft, pleasing tomorrow-inspired palette
- Dracula Official - Popular purple and cyan theme
- Night Owl - Optimized for night coding
- One Dark Pro - VS Code's beloved dark theme
- Tokyo Night - Vibrant colors inspired by Tokyo's neon nights
- Moonlight - Smooth blue-purple gradients
- Cyberpunk 2077 - Neon cyan and yellow aesthetics
- Cobalt2 - High contrast with warm accents
- Noctis - Warm, comfortable color scheme
- Catppuccin - Soothing pastel dark theme
- Monokai Pro - Modern take on classic Monokai
All themes feature:
- ✅ WCAG 2.1 AA compliant contrast ratios (4.5:1 for text, 7:1+ for links)
- ✅ Distinct colors for regular and visited links
- ✅ Accessible hover states without jarring brightness
- ✅ Colorblind-friendly palettes
Want to create your own theme? See CUSTOM_THEMES.md for a complete guide!
- Clone this repo:
git clone https://github.com/abdul/hckrnews-dark-mode.git
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top right)
- Click Load unpacked
- Select the
hckrnews-dark-modefolder - Visit hckrnews.com and enjoy!
- Click the extension icon in your Chrome toolbar
- Select your preferred theme from the dropdown
- Theme applies instantly and saves automatically
- Extension Popup: Click the extension icon (shows current theme selection)
- In-Page Button: Use the toggle button in the top-right corner of the site
- 🌙 Dark Mode - Activate dark mode
- ☀️ Light Mode - Return to original light theme
- Click the extension icon in your Chrome toolbar
- Check Enable Auto Refresh to turn on automatic page refreshing
- Set Interval (seconds) to your desired refresh frequency
- Minimum: 5 seconds
- Maximum: 3600 seconds (1 hour)
- Default: 60 seconds
- Settings apply immediately and save automatically
Your preferences persist across:
- ✅ Browser sessions
- ✅ Multiple tabs
- ✅ Browser restarts
- WCAG 2.1 AA Compliant - All color combinations tested for accessibility
- High Contrast Text - Minimum 4.5:1 ratio for readability
- Distinct Links - Clear differentiation between regular and visited links
- Smooth Hover States - Color-shift hover effects (no bright opacity flashes)
- Clean Navigation - Minimal underline style for selected pages
- Keyboard Friendly - Full keyboard navigation support
hckrnews-dark-mode/
├── manifest.json # Extension configuration
├── content.js # Main script with themes, logic, and auto-refresh
├── popup.html # Extension popup interface
├── popup.js # Popup functionality
├── popup.css # Popup styling
├── icon16.png # Extension icon (16px)
├── icon48.png # Extension icon (48px)
├── icon128.png # Extension icon (128px)
└── README.md # This file
- Content script injects theme-specific CSS variables
- Toggle button and popup communicate via Chrome storage API
- Theme and auto-refresh preferences stored in
chrome.storage.sync - CSS applied dynamically based on selected theme
- Navigation elements styled with accessible underlines
- Auto-refresh uses
setIntervalto reload page at specified intervals
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Add new themes to the
themesobject incontent.js - Ensure WCAG AA compliance (use WebAIM Contrast Checker)
- Update theme dropdown in
popup.html
- Add new themes to the
- Commit your changes
git commit -m 'Add amazing feature' - Push to your fork
git push origin feature/amazing-feature
- Open a Pull Request
For detailed instructions on creating custom themes, see CUSTOM_THEMES.md
Quick overview:
- Add your theme to the
themesobject incontent.js - Add it to the dropdown in
popup.html - Verify WCAG AA compliance using WebAIM Contrast Checker
Important: All themes must meet WCAG AA accessibility standards!
Abdul Qabiz
- Website: abdulqabiz.com
- GitHub: @abdul
- Repository: hckrnews-dark-mode
MIT License - feel free to use, modify, and distribute!
See LICENSE for full details.
- Inspired by the Hacker News community
- Color schemes based on popular code editor themes
- Accessibility guidelines from WCAG 2.1
- Built for hckrnews.com - an unofficial HN interface
Found a bug or have a feature request?
- Open an issue on GitHub
- Ensure WCAG compliance when suggesting color changes
- Include screenshots if reporting visual issues
Enjoy your dark mode experience! 🌙✨
