docs: recolour the Get started button to the StackGuardian blue - #278
Closed
refeed wants to merge 1 commit into
Closed
docs: recolour the Get started button to the StackGuardian blue#278refeed wants to merge 1 commit into
refeed wants to merge 1 commit into
Conversation
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.
|
❌ The last analysis has failed. |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Member
Author
|
Superseded by #279, which carries this commit unchanged alongside the logo change so the two land as one review. |
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.
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 ownbutton--primary:--ifm-color-primaryincustom.cssis 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
#007affis 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#006ee6— 4.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-inverseand flips per theme. That variable is how this button's text ended up invisible once already — an earlier version set the label tovar(--ifm-background-color), which is#0000in light mode. Literal#fffrenders identically in both themes.Verified
npm run buildsucceeds, and the change is present in the output rather than only in source:build/assets/css/styles.*.csscontains.heroPrimary_i6PQ{--ifm-button-background-color:#006ee6;…--ifm-button-color:#fff}and the hover/active rule.build/index.htmlshowsclass="button button--lg button--primary heroPrimary_i6PQ"on the Get started anchor; the GitHub anchor still carries onlybutton--secondary.Infima wraps its
.button--primaryrules 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.