Testing Dark Mode
Quick Testing Options
Option 1: Interactive Demo (Recommended)
The easiest way to test the dark mode implementation:
- Open
dark-mode-demo.htmlin your browser:# In the project directory open dark-mode-demo.html # macOS # or xdg-open dark-mode-demo.html # Linux # or just drag the file to your browser - Click the buttons to toggle between:
- ☀️ Light Mode only
- 🌙 Dark Mode only
- 👁️ Compare Both side-by-side
Option 2: Test with Browser DevTools
- Open
test-preview.htmlin your browser - Open DevTools (F12)
- Press
Cmd/Ctrl + Shift + Pto open Command Palette - Type “Rendering” and select “Show Rendering”
- Find “Emulate CSS media feature prefers-color-scheme”
- Toggle between
lightanddarkto see the changes
Option 3: Test with System Settings
- Open
test-preview.htmlin your browser - Change your system’s appearance settings:
- macOS: System Preferences → General → Appearance → Dark
- Windows 10/11: Settings → Personalization → Colors → Dark
- Linux (GNOME): Settings → Appearance → Dark
- The page should automatically switch to dark mode
Option 4: Local Jekyll Server
If you have Jekyll installed:
# Install dependencies (first time only)
gem install jekyll bundler
# Serve the site locally
jekyll serve
# Visit http://localhost:4000
Then use any of the browser testing methods above.
What to Look For
When testing dark mode, verify:
✅ Background colors switch from light to dark ✅ Text colors are readable with good contrast ✅ Links are clearly visible in both modes ✅ Code blocks have appropriate syntax highlighting ✅ Navigation is clearly visible ✅ Borders and dividers are visible but not harsh ✅ Widget area (sidebar) adapts correctly ✅ Footer text is readable
Testing Checklist
- Homepage displays correctly in light mode
- Homepage displays correctly in dark mode
- Blog post content is readable in both modes
- Code syntax highlighting works in both modes
- Links are distinguishable and readable
- Navigation menu is functional in both modes
- Sidebar widgets adapt to dark mode
- Footer is readable in both modes
- Smooth transition between modes
- No color contrast accessibility issues
Browser Compatibility
The dark mode should work in:
- ✅ Chrome/Edge 76+
- ✅ Firefox 67+
- ✅ Safari 12.1+
- ✅ Opera 62+
Automated Testing (Advanced)
If you want to capture screenshots programmatically:
Using Chrome Headless
# Light mode screenshot
google-chrome --headless --screenshot=light-mode.png --window-size=1280,1024 \
--force-color-profile=srgb test-preview.html
# Dark mode screenshot (requires Chrome 96+)
google-chrome --headless --screenshot=dark-mode.png --window-size=1280,1024 \
--force-color-profile=srgb --force-dark-mode test-preview.html
Using Firefox Screenshot
firefox --screenshot light-mode.png test-preview.html
GitHub Pages Deployment
Once merged to the main branch, test on the live site:
- Visit https://rlbisbe.net
- Use browser DevTools to toggle dark mode
- Verify all pages render correctly
Troubleshooting
Dark mode not activating?
- Check that
dark-mode.cssis loaded (DevTools → Network tab) - Verify browser supports
prefers-color-schememedia query - Try hard refresh (Cmd/Ctrl + Shift + R)
Colors look wrong?
- Check browser zoom level (should be 100%)
- Verify no browser extensions are interfering with CSS
- Clear browser cache
Iframe not showing content?
- If testing locally, make sure you’re serving via HTTP, not file://
- Use
python3 -m http.server 8000and visit http://localhost:8000/dark-mode-demo.html