Skip to content

[codex] Add dark mode to documentation site#2586

Merged
calda merged 3 commits into
nicklockwood:developfrom
Brett-Best:codex/documentation-dark-mode
Jul 6, 2026
Merged

[codex] Add dark mode to documentation site#2586
calda merged 3 commits into
nicklockwood:developfrom
Brett-Best:codex/documentation-dark-mode

Conversation

@Brett-Best

Copy link
Copy Markdown
Contributor

Summary

  • Adds system dark mode support to the documentation site via CSS custom properties and prefers-color-scheme.
  • Updates generated Rouge syntax CSS to include both github.light and github.dark themes.

Notes

  • Consulted CONTRIBUTING.md for branch/PR conventions and site/README.md for the Jekyll site workflow.
  • The workspace AGENTS.md says PRs should target develop, so this PR uses develop as the base branch.

Validation

  • ruby -c site/site_content.rb
  • git diff --check
  • RBENV_VERSION=3.4.1 BUNDLE_PATH=/private/tmp/swiftformat-bundle rbenv exec bundle exec rake site:build
  • Captured screenshot evidence for both impacted site pages in light/dark mode at desktop and mobile widths.

Screenshots

Home

Desktop light Desktop dark
Home desktop light Home desktop dark
Mobile light Mobile dark
Home mobile light Home mobile dark

Rules

Desktop light Desktop dark
Rules desktop light Rules desktop dark
Mobile light Mobile dark
Rules mobile light Rules mobile dark

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.38%. Comparing base (92882ca) to head (0f316e1).
⚠️ Report is 1 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Brett-Best

Copy link
Copy Markdown
Contributor Author

@calda the website looks good however it was very bright! Here is a vibe coded dark mode 🙏🏻, looks reasonable 🤔

@Brett-Best Brett-Best marked this pull request as ready for review July 6, 2026 17:00
Copilot AI review requested due to automatic review settings July 6, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.css that contains both github.light and github.dark Rouge themes, applying the dark theme via prefers-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
@calda calda force-pushed the codex/documentation-dark-mode branch from 9a8cf76 to 04daa71 Compare July 6, 2026 17:54
@calda

calda commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

I tweaked the theming a bit to be slightly less black, similar to the github.com light dark theme (more similar to macOS dark mode).

image

@calda calda force-pushed the codex/documentation-dark-mode branch from 04daa71 to 0f316e1 Compare July 6, 2026 17:56
@calda calda merged commit a7bc2b5 into nicklockwood:develop Jul 6, 2026
14 checks passed
calda added a commit that referenced this pull request Jul 6, 2026
Co-authored-by: Cal Stephens <cal@calstephens.tech>
@Brett-Best Brett-Best deleted the codex/documentation-dark-mode branch July 6, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants