[codex] Add dark mode to documentation site#2586
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2586 +/- ##
========================================
Coverage 95.38% 95.38%
========================================
Files 176 176
Lines 26193 26193
========================================
+ Hits 24983 24985 +2
+ Misses 1210 1208 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@calda the website looks good however it was very bright! Here is a vibe coded dark mode 🙏🏻, looks reasonable 🤔 |
There was a problem hiding this comment.
Pull request overview
Adds automatic (system) dark mode support for the SwiftFormat documentation site by introducing a small design-token layer (CSS custom properties) and generating a dark-mode Rouge syntax highlighting stylesheet gated by prefers-color-scheme.
Changes:
- Introduces color custom properties in
:root, with dark-mode overrides under@media (prefers-color-scheme: dark), and updates existing selectors to use them. - Updates site generation to produce a single
syntax.cssthat contains bothgithub.lightandgithub.darkRouge themes, applying the dark theme viaprefers-color-scheme.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| site/src/assets/css/style.css | Adds theme variables + dark-mode overrides and migrates existing hardcoded colors to variables for consistent light/dark rendering. |
| site/site_content.rb | Generates combined light+dark Rouge syntax CSS, wrapping the dark theme output in a prefers-color-scheme: dark media query. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rk-mode # Conflicts: # site/site_content.rb # site/src/assets/css/style.css
9a8cf76 to
04daa71
Compare
04daa71 to
0f316e1
Compare
Co-authored-by: Cal Stephens <cal@calstephens.tech>

Summary
prefers-color-scheme.github.lightandgithub.darkthemes.Notes
CONTRIBUTING.mdfor branch/PR conventions andsite/README.mdfor the Jekyll site workflow.AGENTS.mdsays PRs should targetdevelop, so this PR usesdevelopas the base branch.Validation
ruby -c site/site_content.rbgit diff --checkRBENV_VERSION=3.4.1 BUNDLE_PATH=/private/tmp/swiftformat-bundle rbenv exec bundle exec rake site:buildScreenshots
Home
Rules