Skip to content

Upgrade Primer and follow the system dark mode - #35

Merged
koenpunt merged 1 commit into
masterfrom
claude/adaptive-dark-mode-yjy7qg
Oct 17, 2026
Merged

koenpunt merged 1 commit into
masterfrom
claude/adaptive-dark-mode-yjy7qg

Conversation

@koenpunt

Copy link
Copy Markdown
Contributor

Requested by Koen · project thread

Before: deliverybot.dev is always light, styled by a copy of Primer from 2019 that is checked into assets/primer.css.

After: the site follows the visitor's OS light or dark setting, like the dashboard. In light mode it looks the same as before. Code blocks, the docs menu, cards, labels and the footer all switch with the color mode, and the GitHub logo turns white on dark.

Why

The dashboard is moving to Primer 22 with adaptive dark mode (deliverybot/deliverybot#187). The site should match it, and the vendored Primer was too old to support color modes.

How

  • Primer 22.3.2, @primer/primitives and @primer/view-components (Box, Label and menus moved there) come from npm, the same versions as the dashboard. assets/primer.scss pulls them in through Jekyll's Sass converter (sass.load_paths: [node_modules]), so the output is still /assets/primer.css.
  • <html data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"> plus <meta name="color-scheme"> turn on the system color mode.
  • Layouts use Primer's functional utilities (color-fg-*, color-bg-*, color-shadow-*, Label--secondary) instead of the removed fixed-color classes.
  • Rouge token colors map to Primer's syntax color tokens, and the footer uses the header tokens.
  • main.css keeps the site's original marketing heading sizes, because Primer 22 made h1-mktg and friends much larger and heavier.
  • The Pages workflow runs npm ci before the build, and Dependabot watches npm.

I checked every page type in light and dark at desktop and phone widths against the old site. make build && make test pass.


Generated by Claude Code

Replace the vendored 2019 Primer CSS with Primer 22 from npm, bundled by
Jekyll's Sass converter, and switch the layouts to Primer's functional
color utilities. With the light and dark themes loaded and
data-color-mode="auto", the site follows the visitor's OS setting.

Code blocks use Primer's syntax colors, the footer uses the header
tokens, and the site keeps its original marketing type scale.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TvBcEDnS21QBKzbWVeHKuQ
@koenpunt koenpunt self-assigned this Oct 17, 2026
@koenpunt
koenpunt marked this pull request as ready for review October 17, 2026 09:55
@koenpunt
koenpunt merged commit a4ce1bf into master Oct 17, 2026
2 checks passed
@koenpunt
koenpunt deleted the claude/adaptive-dark-mode-yjy7qg branch October 17, 2026 10:32
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.

2 participants