[css-scroll-snap] Ability to override mandatory snapping via “scroll and hold”
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the issue's CSS Scroll Snap examples, especially scroll-snap-type and scroll-snap-align, along with the described trackpad and touch interactions. Define how mandatory snapping could be overridden, whether a new CSS property is needed, and how the behavior should work across input devices before proposing a specification change.
Written by the indexing model from the issue text.
Description
I am experimenting with adding scroll snapping to my Twitter timeline via user styles (the Stylus browser extension). This is the code that I have right now:
html {
scroll-snap-type: y mandatory !important;
scroll-behavior: smooth !important;
}
/* each tweet in the timeline is an <article> element */
article {
scroll-snap-align: start !important;
}
/* un-stick the sticky header and make it a snap position as well */
[aria-label="Home timeline"] > :first-child {
position: static !important;
scroll-snap-align: start !important;
}
/* hide annoying toast notification */
[aria-label="New Tweets are available."] {
display: none !important;
}
I had to pick between proximity and mandatory snapping. I chose mandatory because I like how it always scrolls a tweet to the top whenever I press the Space bar. Sometimes it scrolls more, sometimes less, but there is always the start of a tweet at the top of the viewport on each key press. It works really well in Firefox Nightly. Take a look:
https://user-images.githubusercontent.com/716405/180671576-f7440459-00c2-4046-b9a3-08690d685cba.mp4
However, there is a problem. When a tweet is taller than my viewport, it seems to be impossible to view the bottom of the tweet because the browser forcefully snaps this tweet (or the next tweet) to the top. Even when I switch to proximity snapping, I also sometimes experience this problem (depending on the browser and other factors). See the problem here:
https://user-images.githubusercontent.com/716405/180671880-7bf68f3f-ba0c-4a30-a435-a44d269e4ffc.mp4
My ideal experience would be this:
- forced (mandatory) snapping when I press the Space bar (and Shift + Space bar for the other scrolling direction)
- an ability to override forced snapping
I suggest the following: On my laptop’s trackpad, if I scroll (two-finger vertical swipe) but then hold that position (fingers still touching the trackpad) for a second or so, this would instruct the browser to lock that scroll position, which would override snapping. This could also work on touch screens. I’m not sure what to do about PCs without trackpads; maybe a modifier key?
This ability could also be disabled by default (to not risk breaking existing websites), and there could be a new CSS property that would allow websites to unlock this ability for its visitors.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 24
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/csswg-drafts
-
Agenda+ css-sizing-4 css-values-5
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
w3c/csswg-drafts#14502 · 1 reaction ·
-
css-values-5 editorial Needs Edits
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
w3c/csswg-drafts#14498 · 2 comments ·
-
css-overflow-4 topic: line-clamp
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
w3c/csswg-drafts#14485 · 1 comment ·
-
Administrative Tracker css-values-4
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
w3c/csswg-drafts#14482 · 4 comments · 1 reaction ·
-
css-values-5 Needs Edits
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
w3c/csswg-drafts#14466 ·
All issues in w3c/csswg-drafts
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
tvOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bvaughn/react-resizable-panels#751 · 1 comment ·
-
www.wiwo.de OpenN: AdGuard Browser Extension P3: Medium T: Annoyance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
AdguardTeam/AdguardFilters#242026 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 92/100