Repository navigation
fix(link): keep external-link arrow visible in forced-colors - #234
Merged
abbybowman merged 3 commits intoOct 7, 2026
Merged
Conversation
The arrow is drawn with mask-image plus background-color. Forced-colors mode drops mask-image painting outright, independent of the background-color value, so the masked arrow disappears no matter what color it's given. Opt the pseudo-element out of forced colors and repaint it manually in CanvasText, matching the .usa-social-link precedent already in the codebase. Default rendering is unchanged. Refs nasa#229 (external-link item only).
nulluid
force-pushed
the
fix/external-link-forced-colors-229
branch
from
September 14, 2026 07:33
7cc44e5 to
eb1fa01
Compare
4 of 11 tasks
7 of 11 tasks
abbybowman
self-requested a review
October 6, 2026 19:49
abbybowman
approved these changes
Oct 6, 2026
abbybowman
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix @nulluid! I confirmed in native Windows that the externa link arrow still paints in CanvasText without the opt-out, so I pushed a commit removing it, rewording the comment, and dropping the matching test assertion. Credit to @suthat for flagging this in #259. Merging once CI is green, appreciate your help!
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 this PR does
Keeps the external-link diagonal arrow visible in forced-colors mode (Windows High Contrast) by opting the icon out of forced colors and repainting it with the system
CanvasTextcolor.Closes #229 (external-link item only)
Type of change
How to review
Open the Link stories with
forced-colors: activeenabled (DevTools > Rendering, or a Windows contrast theme) and check an external link. The diagonal arrow should stay visible, painted in black (CanvasText) against the Canvas background. Default rendering is unchanged.Before requesting review
npm run lint,npm run format, andnpm testpass locallyIf your change affects how anything renders (styles, tokens, story markup, icons, or fonts):
If your change ships in the package (styles, tokens, or
src/assets/**):npx changeset) at the semver rubric levelnpm run check:api-snapshot; no drift was reportedNotes for reviewers
Root cause: the arrow is painted with
mask-image+background-color. Forced-colors mode drops mask-image painting outright, independent of the color value, so settingbackground-coloralone is not enough (confirmed by rendering in a real browser with forced-colors emulated, not just by reading the compiled CSS). The fix addsforced-color-adjust: nonealongside theCanvasTextbackground, matching the existing.usa-social-linkprecedent in this codebase for the same problem.Regression test compiles the Sass and asserts both
background-color: CanvasTextandforced-color-adjust: noneon.usa-link--external::afterinside the forced-colors media block, following the pattern from #232.