Repository navigation
Upgrade Primer and follow the system dark mode - #35
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/primitivesand@primer/view-components(Box, Label and menus moved there) come from npm, the same versions as the dashboard.assets/primer.scsspulls 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.color-fg-*,color-bg-*,color-shadow-*,Label--secondary) instead of the removed fixed-color classes.main.csskeeps the site's original marketing heading sizes, because Primer 22 madeh1-mktgand friends much larger and heavier.npm cibefore 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 testpass.Generated by Claude Code