Primer branding: replace hard-coded hex colors with existing theme tokens - #260
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The changes are localized, use already-defined theme tokens, and remove redundant dark-mode CSS without introducing unresolved references.
Pull request overview
Updates the site’s Primer-aligned styling to eliminate a couple of hard-coded color literals in favor of existing theme-aware tokens, improving light/dark parity and keeping branding consistent across the wizard UI.
Changes:
- Replaced the
.prompt-preview::afterfade gradient’s hard-coded transparent RGB stop(s) withtransparent, relying on the already theme-aware--code-bgend color (and removing the dark-mode override). - Replaced
.landing-glow’s off-palette orangergba(255, 112, 67, …)with the existing--agent-purple-rgbtoken.
File summaries
| File | Description |
|---|---|
| src/styles/style.css | Swaps hard-coded gradient/glow color literals for existing theme tokens to ensure consistent branding and light/dark support. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
What changed
Color
.landing-glow: replaced the hard-codedrgba(255, 112, 67, ...)(an off-palette orange with no light/dark variants) withrgba(var(--agent-purple-rgb), ...), an existing brand-aligned accent already used consistently across the "agent" UI (buttons, badges, hero glow). This keeps the warm/cool blend on-brand and gives it automatic light/dark parity, which the orange literal lacked..prompt-preview::after/[data-color-mode="dark"] .prompt-preview::after: replaced two hard-coded RGB fade colors (rgba(246, 248, 250, 0)light,rgba(13, 17, 23, 0)dark) with a singletransparentstop feeding intovar(--code-bg). Both are fully transparent at the top of the gradient, so the color itself is irrelevant — usingtransparentremoves hard-coded hex values entirely and eliminates the need for a separate dark-mode override, since the destination color (--code-bg) is already theme-aware.Guidance motivating each change
From the
primer-brandMCP token/doc lookups performed for this audit:--brand-color-accent-primary,--brand-color-accent-secondary) rather than as one-off hex values, so custom accent colors should route through a project's existing themed variable rather than introduce a new unreferenced hex.--accent-blue,--accent-green,--agent-purple, each with-rgbcompanions defined in both:rootand the dark-mode block). The strayrgba(255, 112, 67, ...)in.landing-glowwas the only accent color in the file with no themed variable and no dark-mode counterpart, breaking light/dark parity that the rest of the palette maintains.Deviations found but not fixed
var(--color-*, #hex)fallback patterns (e.g.--bg-primary: var(--color-canvas-default, #ffffff)). These are intentional CSS custom-property fallbacks for when Primer CSS variables aren't loaded, not off-brand hard-coding, so left as-is.-rgbtokens and didn't need color changes.Validation
npm test: 319/319 tests passed.npm run build(vite build): succeeded. Note: the repo'sprebuildscript (fetch-vendor-assets.mjs) requires network access to the npm registry to vendor@primer/css, which is unavailable in this sandboxed environment;vite builditself completed successfully once invoked directly.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
registry.npmjs.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.