You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[css-snappoints] Adding point snapping and axis syntax to scroll-snap-type with alternative syntax proposal based loosely on suggestion from Tab, for discussion in f2f tomorrow
<a>snap positions</a> are enforced on the <a>scroll container</a>
276
+
(by forcing an adjustment to the scroll offset).
277
+
Values are defined as follows:
271
278
272
279
Issue: <a href="https://lists.w3.org/Archives/Public/www-style/2015Nov/0328.html">Open issue</a> on whether to enhance the scroll-snap-type property for specifying the axis or adding a second property. We have <a href="https://lists.w3.org/Archives/Public/www-style/2015Dec/0048.html">resolved</a> that this functionality be added once the issue is resolved.
273
280
@@ -291,6 +298,42 @@ Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
291
298
If the content changes such that the scroll container would no longer be <a>snapped</a> (e.g. content is added, moved, deleted, resized) to the same snap position it was snapped to before the content change and that same snap position still exists (e.g. its associated element was not deleted) and is reachable, the scroll container must be re-snapped to that same snap position after the content change.
292
299
</dl>
293
300
301
+
The <dfn noexport lt="axis value">axis values</dfn>
302
+
specify what axis(es) are affected by <a>snap positions</a>,
303
+
and whether <a>snap positions</a> are evaluated independently per axis,
304
+
or together as a 2D point.
305
+
Values are defined as follows:
306
+
307
+
<dl dfn-type=value dfn-for="scroll-snap-type">
308
+
<dt><dfn>x</dfn>
309
+
<dd>
310
+
The <a>scroll container</a><a>axis-snaps</a> to <a>snap positions</a> in its horizontal axis using the corresponding <a>strictness value</a>.
311
+
312
+
<dt><dfn>y</dfn>
313
+
<dd>
314
+
The <a>scroll container</a><a>axis-snaps</a> to <a>snap positions</a> in its vertical axis using the corresponding <a>strictness value</a>.
315
+
316
+
<dt><dfn>block</dfn>
317
+
<dd>
318
+
The <a>scroll container</a><a>axis-snaps</a> to <a>snap positions</a> in its block axis using the corresponding <a>strictness value</a>.
319
+
320
+
<dt><dfn>inline</dfn>
321
+
<dd>
322
+
The <a>scroll container</a><a>axis-snaps</a> to <a>snap positions</a> in its inline axis using the corresponding <a>strictness value</a>.
323
+
324
+
<dt><dfn>point</dfn>
325
+
<dd>
326
+
The <a>scroll container</a><a>point-snaps</a> to <a>snap positions</a> in both axises simultaneously,
327
+
treating each element’s <a>snap position</a> as a single 2D position
328
+
(rather than potentially snapping to different elements in each axis).
329
+
</dl>
330
+
331
+
If <a>axis values</a> are not specified, then the axis is automatically computed:
332
+
333
+
* If only one <a>strictness value</a> is specified, the <a>scroll container</a><a>axis-snaps</a> in both axes using that <a>strictness value</a>.
334
+
* If two <a>strictness values</a> are specified and no <a>axis values</a> are specified, the <a>scroll container</a><a>axis-snaps</a> in the horizontal axis using the first <a>strictness value</a> and in the vertical axis using the second <a>strictness value</a>.
335
+
* If two <a>strictness values</a> are specified and one <a>axis value</a> is specified, the axis perpendicular to the specified <a>axis value</a> is used for the other <a>strictness value</a>.
336
+
294
337
Advisement:
295
338
Authors should use mandatory snap positions with consideration of
296
339
varyingly-sized screens and (if applicable) varying-sized content.
The scroll offset which aligns the center of this box's scroll snap area with the center of its ancestor scroll container's region defined by 'scroll-snap-padding' in the specified axis is a <a>snap position</a> in that axis.
445
488
</dl>
446
489
490
+
<!--
491
+
██ ████████ ███████ ████████
492
+
████ ██ ██ ██ ██ ██ ██
493
+
██ ██ ██ ██ ██ ██
494
+
██ ██ ██ ███████ ██ ██
495
+
██ ██ ██ ██ ██ ██
496
+
██ ██ ██ ██ ██ ██
497
+
██████ ████████ █████████ ████████
498
+
-->
499
+
500
+
Axis vs Point-Snapping {#snap-dimensions}
501
+
-----------------------------------------
502
+
503
+
Issue: This feature is planned to be removed in the next publication
504
+
in order to reduce the feature-set of Level 1.
505
+
It is included here for future reference in defining Level 2.
506
+
507
+
There are two distinct <dfn lt="snap behavior|snapping behavior">snapping behaviors</dfn> that a <a>scroll container</a> might engage in:
0 commit comments