Repository navigation
🐛 fix(style): honour prefers-reduced-motion for in-page smooth scrolling - #281
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
2e9ae28 to
33e4e52
Compare
There was a problem hiding this comment.
Read the tree at 33e4e52, not just the diff. This looks correct to me.
style.css:92-93:scroll-behavior: smoothis now the only declaration inside@media (prefers-reduced-motion: no-preference);-webkit-text-size-adjuststays unconditional, so nothing else changed for either audience.- Consistent with the rest of the sheet, which already gates motion on the same query (
style.css:267,:275,:508,:579) and with the carousel JS (index.html:1077,scrollBehavior()), so this was the one remaining unguarded animation. - The new test in
scripts/style-contract.test.mjsuses the existingstripComments/stylesheetshelpers (lines 63, 603). Rannode --test scripts/style-contract.test.mjs: 45/45 pass at this head; reverting line 92 to the oldhtml { scroll-behavior: smooth; … }makes exactly that test fail withscroll-behavior: smooth at line 92 is not inside @media (prefers-reduced-motion: no-preference), so it is a real regression guard.
Body matches the diff (Closes #280). Only tide is pending; all other checks green.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…r rule (#283) * test(style): fixture self-tests for the reduced-motion scroll-behavior rule Extract the rule #281 added inline into unguardedSmoothScroll(css, label), matching the exported-helper-plus-fixture shape of every other rule in style-contract.test.mjs. The helper now also catches smooth !important, a block-final declaration without a trailing semicolon and upper-case values, and runs over every page's inline <style> as the sibling rules do. Closes #282 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> * test(style): string-aware reduced-motion parser and tidy helper placement - Move unguardedSmoothScroll above the fixture self-tests banner so it sits with the other rule helpers. - Skip string contents while scanning so a "{" or ";" inside one cannot leave a guarding @media prelude on the stack. - Stop the value scan at "{" so a prelude such as @supports (scroll-behavior: smooth) still records its block and the nested declarations are examined. - Assert the clean CSS fixture against unguardedSmoothScroll and add fixtures for both parser cases. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --------- Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #280
top-level
html { scroll-behavior: smooth }animated every skip-link / nav-anchor / hash jump even for reduced-motion users while the carousel JS and the other CSS already honour the preference. Now scoped to@media (prefers-reduced-motion: no-preference)so users who opt out of motion are respected. Regression test added to style-contract.test.mjs.— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88