[wp-trac] [WordPress Trac] #48763: Twenty Twenty: SmoothScroll is broken
WordPress Trac
noreply at wordpress.org
Fri Dec 6 00:17:19 UTC 2019
#48763: Twenty Twenty: SmoothScroll is broken
---------------------------+-------------------------
Reporter: joostdevalk | Owner: audrasjb
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 5.3.1
Component: Bundled Theme | Version: 5.3
Severity: normal | Resolution:
Keywords: has-patch | Focuses: javascript
---------------------------+-------------------------
Changes (by audrasjb):
* keywords: needs-patch => has-patch
* owner: (none) => audrasjb
* status: new => accepted
Comment:
Hi,
This is a brillant idea @melchoyce , thanks! ⭐️
In `48763.diff`, I removed `smoothScroll` JS function and I replaced it
with `scroll-behavior` CSS property.
It works pretty well (see screenshots above).
Also worth noting that I added a small accessibility enhancement by using
`prefers-reduced-motion: reduce` media query property for users that don't
want motion effects. For further explanation on this media query, see MDN
documentation: https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-
behavior#Accessibility_concerns
Cheers,
Jb
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48763#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list