Skip to content

docs: recolour the Get started button to the StackGuardian blue - #278

Closed
refeed wants to merge 1 commit into
mainfrom
docs/hero-button-color
Closed

docs: recolour the Get started button to the StackGuardian blue#278
refeed wants to merge 1 commit into
mainfrom
docs/hero-button-color

Conversation

@refeed

@refeed refeed commented Aug 13, 2026

Copy link
Copy Markdown
Member

Recolours the hero Get started button to the blue from the StackGuardian icon.

Scoped to the button, on purpose

The colour is applied by overriding the --ifm-button-* custom properties on a CSS-module class, added alongside Docusaurus's own button--primary:

.heroPrimary {
  --ifm-button-background-color: #006ee6;
  --ifm-button-border-color: #006ee6;
  --ifm-button-color: #fff;
}

--ifm-color-primary in custom.css is deliberately untouched. That variable also drives link colour, sidebar highlights and admonitions on every page, so changing it would repaint the whole site to recolour one button. The secondary "GitHub" button is unchanged.

The icon's exact blue fails contrast, so the fill is one shade darker

Sampled from the source PNG with a standard-library decoder: the dominant opaque colour is #007aff, confirmed at seven probe points and by a histogram over the image.

White on #007aff is 4.02:1, which is below the 4.5:1 WCAG AA threshold for normal text. Rather than ship that, the fill is the same hue darkened to #006ee64.80:1 — with hover and active at #0062cc (5.80:1). It reads as the icon blue while remaining legible.

If you would rather have the exact #007aff, it is a one-character change and the button text is large, where AA only requires 3:1 — but it is a conscious trade, so I did not make it silently.

The label is pinned to opaque white

Not left to --ifm-button-color, which resolves through --ifm-font-color-base-inverse and flips per theme. That variable is how this button's text ended up invisible once already — an earlier version set the label to var(--ifm-background-color), which is #0000 in light mode. Literal #fff renders identically in both themes.

Verified

npm run build succeeds, and the change is present in the output rather than only in source:

  • build/assets/css/styles.*.css contains .heroPrimary_i6PQ{--ifm-button-background-color:#006ee6;…--ifm-button-color:#fff} and the hover/active rule.
  • build/index.html shows class="button button--lg button--primary heroPrimary_i6PQ" on the Get started anchor; the GitHub anchor still carries only button--secondary.

Infima wraps its .button--primary rules in :where(), so a single module class wins on base, hover and active without !important.

Based on main, and touches different files from #277, so the two do not conflict.

The hero button used the site primary. It now uses the blue from the
StackGuardian icon, scoped to that one button by overriding the --ifm-button-*
properties on a CSS-module class -- deliberately not by changing
--ifm-color-primary, which also drives links, sidebar highlights and
admonitions across every page.

The icon's exact blue is #007aff, which gives only 4.02:1 against white and so
fails WCAG AA for normal text. The fill is the same hue darkened to #006ee6
(4.80:1), and darker again on hover. The label is pinned to opaque white rather
than left to --ifm-button-color, which resolves per theme -- the same variable
whose light-mode value made this button's text invisible once already.
Copilot AI lite review requested due to automatic review settings August 13, 2026 14:02

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

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

@refeed

refeed commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Superseded by #279, which carries this commit unchanged alongside the logo change so the two land as one review.

@refeed refeed closed this Aug 13, 2026
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