Skip to content

UnderlineNav: respect prefers-reduced-motion for the loading counter - #8656

Open
RafaelHDSV wants to merge 1 commit into
primer:mainfrom
RafaelHDSV:RafaelHDSV/underline-nav-reduced-motion
Open

RafaelHDSV wants to merge 1 commit into
primer:mainfrom
RafaelHDSV:RafaelHDSV/underline-nav-reduced-motion

Conversation

@RafaelHDSV

Copy link
Copy Markdown

Closes #8651

The loading-counter pulse on UnderlineNav / TabNav ran for as long as the count was fetching, with no prefers-reduced-motion guard. The same “something is coming” treatment on SkeletonBox, ProgressBar, and SegmentedControl already opts in to motion.

The counter still renders as a solid grey pill. The 1.2s opacity animation only runs when the visitor has not asked for reduced motion.

Changelog

New

n/a

Changed

  • LoadingCounter (UnderlineNav / TabNav): wrap the pulse animation in @media (prefers-reduced-motion: no-preference)

Removed

n/a

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui
  • Ships with feature flag(s)
  • Not sure
  • None

Testing & Reviewing

  1. Open an UnderlineNav story with loadingCounters (or TabNav in a loading-count state).
  2. DevTools → Rendering → Emulate CSS media feature prefers-reduced-motion: reduce.
  3. The grey pill should stay at full opacity; computed animation-name should be none.
  4. Switch the emulation to no-preference: the pulse should still run (loadingCounterKeyFrames).

Visual snapshots should be unchanged: the reduced-motion end state is the same fully opaque pill the animation starts from.

@changeset-bot

changeset-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: edc15c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch was successfully deployed

1 active deployment
github-pages — edc15c85 Deployed Oct 31, 2026 by RafaelHDSV via deploy-preview #30293
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.

UnderlineNav: loading counter pulses regardless of prefers-reduced-motion

1 participant