Skip to content

Commit b0ae6b8

Browse files
committed
[css-scroll-snap] Add scroll-snap-padding (brainstorming here, ignore me, it might make sense when I'm done)
1 parent 0a281e3 commit b0ae6b8

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

css-scroll-snap/Overview.bs

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,16 @@ On the scroll container:
158158
<td>High priority
159159
<tr>
160160
<td>''scroll-snap-destination: <<position>>''
161-
<td>''scroll-snap-destination: auto | <<position>>''
162-
<td>Keep this property only if needed for compat.
161+
<td>''scroll-snap-padding: [ <<length>> | <<percentage> ]{1,4}''
162+
<td>
163163
<tr>
164164
<td>'scroll-snap-points-x'
165-
<td>dropped
166-
<td>High priority to drop. :)
165+
<td>'scroll-snap-points-x'
166+
<td>
167167
<tr>
168168
<td>'scroll-snap-points-y'
169-
<td>dropped
170-
<td>High priority to drop. :)
169+
<td>'scroll-snap-points-y'
170+
<td>
171171
<tr>
172172
<td>n/a
173173
<td>''scroll-group-align: [ start | end | edges ]{1,2} | <<position>>#''
@@ -298,6 +298,31 @@ Scroll Snapping Rules: the 'scroll-snap-type' property {#snap-type}
298298

299299
Issue: See <a href="https://lists.w3.org/Archives/Public/www-style/2015Jul/0452.html">discussion on snapping in response to layout</a>.
300300

301+
302+
Scroll Snapping Window: the 'scroll-snap-padding' property {#snap-padding}
303+
-----------------------
304+
305+
306+
<pre class="propdef">
307+
Name: scroll-snap-padding
308+
Value: [ <<length>> | <<percentage>> ]{1,4}
309+
Initial: 0
310+
Applies to: <a>scroll containers</a>
311+
Inherited: no
312+
Percentages: n/a
313+
Computed value: as specified
314+
Animatable: no
315+
Media: interactive
316+
</pre>
317+
318+
The 'scroll-snap-padding' property defines the area of the viewport
319+
that is used as the <a>alignment container</a>
320+
when aligning <a>scroll snap areas</a> to a <a>snap position</a>.
321+
Values are interpreted as for 'padding',
322+
and specify inward offsets from each side.
323+
324+
Issue: Add illustration.
325+
301326
Coordinate-based Snapping {#snap-points}
302327
=========================
303328

@@ -374,11 +399,6 @@ Scroll Snapping Area: the 'scroll-snap-area' property {#the-scroll-snap-area}
374399
Specifies the <dfn>scroll snap area</dfn> that is used for snapping this box to the viewport.
375400
<<length>> values give outsets (similar to 'margin' or 'border-image-outset').
376401

377-
Note: This functionality effectively replaces 'scroll-snap-destination',
378-
in a way that allows for more control in mixed-content environments
379-
(each element can specify its own offsets from the viewport edges)
380-
and also plays better with smaller viewports (see [[#small-viewports]]).
381-
382402
Scroll Snapping Alignment: the 'scroll-snap-align' property {#scroll-snap-align}
383403
--------------------------
384404

0 commit comments

Comments
 (0)