2
2
Title : CSS Gap Decorations Module Level 1
3
3
Shortname : css-gaps
4
4
Level : 1
5
- Status : ED
5
+ Status : FPWD
6
+ Prepare for TR : yes
7
+ Date : 2025-04-17
6
8
Group : csswg
7
9
Work Status : exploring
8
10
Repository : w3c/csswg-drafts
9
11
URL : https://drafts.csswg.org/css-gaps-1
12
+ TR : https://www.w3.org/TR/css-gaps-1/
10
13
Editor : Kevin Babbitt, Microsoft, https://github.com/kbabbitt, w3cid 124689
11
14
Abstract : This module introduces several properties to add row and column gap decorations to container layout types such as grid and flex.
12
15
</pre>
@@ -61,8 +64,10 @@ Gap decorations {#gap-decorations}
61
64
column-rule: 6px solid blue;
62
65
}
63
66
</pre>
64
- <img src="images/example-grid-with-spans.png">
65
- <figcaption> A grid with spanning items and gap decorations.</figcaption>
67
+ <figure>
68
+ <img alt="" src="images/example-grid-with-spans.png">
69
+ <figcaption> A grid with spanning items and gap decorations.</figcaption>
70
+ </figure>
66
71
</div>
67
72
68
73
<div class="example">
@@ -76,8 +81,10 @@ Gap decorations {#gap-decorations}
76
81
column-rule: 6px solid blue;
77
82
}
78
83
</pre>
79
- <img src="images/example-flex.png">
80
- <figcaption> A flexbox with gap decorations.</figcaption>
84
+ <figure>
85
+ <img alt="" src="images/example-flex.png">
86
+ <figcaption> A flexbox with gap decorations.</figcaption>
87
+ </figure>
81
88
</div>
82
89
83
90
Layout and painting {#layout-painting}
@@ -119,14 +126,16 @@ Layout and painting {#layout-painting}
119
126
border: 1px dashed black;
120
127
}
121
128
</pre>
122
- <img src="images/example-gap-intersection-grid.png">
123
- <figcaption>
124
- Locations of <a>gap intersection points</a> in a grid with spanning items.
125
- Note the presence of <a>gap intersection points</a>
126
- even where a spanning item touches the edge of a container,
127
- and where an intersection is flanked by spanning items on either side
128
- (for example between #2 and #6, or #4 and #7).
129
- </figcaption>
129
+ <figure>
130
+ <img alt="" src="images/example-gap-intersection-grid.png">
131
+ <figcaption>
132
+ Locations of <a>gap intersection points</a> in a grid with spanning items.
133
+ Note the presence of <a>gap intersection points</a>
134
+ even where a spanning item touches the edge of a container,
135
+ and where an intersection is flanked by spanning items on either side
136
+ (for example between #2 and #6, or #4 and #7).
137
+ </figcaption>
138
+ </figure>
130
139
</div>
131
140
132
141
<div class="example">
@@ -142,13 +151,15 @@ Layout and painting {#layout-painting}
142
151
border: 1px dashed black;
143
152
}
144
153
</pre>
145
- <img src="images/example-gap-intersection-flex.png">
146
- <figcaption>
147
- Locations of <a>gap intersection points</a> in a flexbox.
148
- Note the presence of <a>gap intersection points</a> at edges of the container,
149
- and the presence of two <a>gap intersection points</a> in close proximity where
150
- items in adjacent rows don't quite line up with each other (between #2, #3, #4, and, #5).
151
- </figcaption>
154
+ <figure>
155
+ <img alt="" src="images/example-gap-intersection-flex.png">
156
+ <figcaption>
157
+ Locations of <a>gap intersection points</a> in a flexbox.
158
+ Note the presence of <a>gap intersection points</a> at edges of the container,
159
+ and the presence of two <a>gap intersection points</a> in close proximity where
160
+ items in adjacent rows don't quite line up with each other (between #2, #3, #4, and, #5).
161
+ </figcaption>
162
+ </figure>
152
163
</div>
153
164
154
165
Note: [[CSS-ALIGN-3#column-row-gap]] defines
@@ -226,7 +237,7 @@ Breaking gap decorations into segments: The 'column-rule-break', 'row-rule-break
226
237
However, the specific phrasing of the definition
227
238
is also intended to address cases such as the one below:
228
239
<br>
229
- <img src="images/flex-offset-gap.png">
240
+ <img alt="" src="images/flex-offset-gap.png">
230
241
<br>
231
242
The four marked <a>gap intersection points</a> fall along a common gap centerline.
232
243
However, because item 3 is slightly wider than items 1 and 5,
@@ -328,11 +339,13 @@ Breaking gap decorations into segments: The 'column-rule-break', 'row-rule-break
328
339
rule-outset: 0px;
329
340
}
330
341
</pre>
331
- <img src="images/example-break-none-grid.png">
332
- <figcaption>
333
- Grid <a>gap decorations</a> with no breaks.
334
- Note that the <a>gap decorations</a> extend "behind" items placed in the grid.
335
- </figcaption>
342
+ <figure>
343
+ <img alt="" src="images/example-break-none-grid.png">
344
+ <figcaption>
345
+ Grid <a>gap decorations</a> with no breaks.
346
+ Note that the <a>gap decorations</a> extend "behind" items placed in the grid.
347
+ </figcaption>
348
+ </figure>
336
349
</div>
337
350
338
351
<div class="example">
@@ -347,11 +360,13 @@ Breaking gap decorations into segments: The 'column-rule-break', 'row-rule-break
347
360
rule-outset: 0px;
348
361
}
349
362
</pre>
350
- <img src="images/example-break-spanning-item-grid.png">
351
- <figcaption>
352
- Grid <a>gap decorations</a> broken at <a>gap intersection points</a>
353
- that are not adjacent to spanning items.
354
- </figcaption>
363
+ <figure>
364
+ <img alt="" src="images/example-break-spanning-item-grid.png">
365
+ <figcaption>
366
+ Grid <a>gap decorations</a> broken at <a>gap intersection points</a>
367
+ that are not adjacent to spanning items.
368
+ </figcaption>
369
+ </figure>
355
370
</div>
356
371
357
372
<div class="example">
@@ -366,11 +381,13 @@ Breaking gap decorations into segments: The 'column-rule-break', 'row-rule-break
366
381
rule-outset: 0px;
367
382
}
368
383
</pre>
369
- <img src="images/example-break-intersection-grid.png">
370
- <figcaption>
371
- Grid <a>gap decorations</a> broken at every <a>gap intersection point</a>
372
- that is not flanked by spanning items on opposing sides.
373
- </figcaption>
384
+ <figure>
385
+ <img alt="" src="images/example-break-intersection-grid.png">
386
+ <figcaption>
387
+ Grid <a>gap decorations</a> broken at every <a>gap intersection point</a>
388
+ that is not flanked by spanning items on opposing sides.
389
+ </figcaption>
390
+ </figure>
374
391
</div>
375
392
376
393
<div class="example">
@@ -385,13 +402,15 @@ Breaking gap decorations into segments: The 'column-rule-break', 'row-rule-break
385
402
rule-outset: 0px;
386
403
}
387
404
</pre>
388
- <img src="images/example-break-none-flex.png">
389
- <figcaption>
390
- Flexbox <a>gap decorations</a> with no breaks.
391
- Note that each flex line has its own distinct gaps.
392
- Therefore, <a>gap decorations</a> in adjacent flex lines
393
- are separate from each other even if the gaps happen to line up.
394
- </figcaption>
405
+ <figure>
406
+ <img alt="" src="images/example-break-none-flex.png">
407
+ <figcaption>
408
+ Flexbox <a>gap decorations</a> with no breaks.
409
+ Note that each flex line has its own distinct gaps.
410
+ Therefore, <a>gap decorations</a> in adjacent flex lines
411
+ are separate from each other even if the gaps happen to line up.
412
+ </figcaption>
413
+ </figure>
395
414
</div>
396
415
397
416
Note: Because flexbox has no concept of spanning items,
@@ -412,10 +431,12 @@ Breaking gap decorations into segments: The 'column-rule-break', 'row-rule-break
412
431
rule-outset: 0px;
413
432
}
414
433
</pre>
415
- <img src="images/example-break-intersection-flex.png">
416
- <figcaption>
417
- Flexbox <a>gap decorations</a> broken at every <a>gap intersection point</a> .
418
- </figcaption>
434
+ <figure>
435
+ <img alt="" src="images/example-break-intersection-flex.png">
436
+ <figcaption>
437
+ Flexbox <a>gap decorations</a> broken at every <a>gap intersection point</a> .
438
+ </figcaption>
439
+ </figure>
419
440
</div>
420
441
421
442
Adjusting gap decoration endpoints: The 'column-rule-outset' , 'row-rule-outset' , and 'rule-outset' properties {#outset}
@@ -455,10 +476,12 @@ Adjusting gap decoration endpoints: The 'column-rule-outset', 'row-rule-outset',
455
476
column-rule-break: intersection;
456
477
}
457
478
</pre>
458
- <img src="images/example-column-outset-0px.png">
459
- <figcaption>
460
- An outset of ''0px'' aligns the ends of <a>gap decorations</a> with adjacent items.
461
- </figcaption>
479
+ <figure>
480
+ <img alt="" src="images/example-column-outset-0px.png">
481
+ <figcaption>
482
+ An outset of ''0px'' aligns the ends of <a>gap decorations</a> with adjacent items.
483
+ </figcaption>
484
+ </figure>
462
485
</div>
463
486
464
487
<div class="example">
@@ -468,11 +491,13 @@ Adjusting gap decoration endpoints: The 'column-rule-outset', 'row-rule-outset',
468
491
column-rule-break: intersection;
469
492
}
470
493
</pre>
471
- <img src="images/example-column-outset-5px.png">
472
- <figcaption>
473
- An outset of ''5px'' extends the ends of <a>gap decorations</a>
474
- slightly beyond the edges of adjacent items.
475
- </figcaption>
494
+ <figure>
495
+ <img alt="" src="images/example-column-outset-5px.png">
496
+ <figcaption>
497
+ An outset of ''5px'' extends the ends of <a>gap decorations</a>
498
+ slightly beyond the edges of adjacent items.
499
+ </figcaption>
500
+ </figure>
476
501
</div>
477
502
478
503
<div class="example">
@@ -482,7 +507,8 @@ Adjusting gap decoration endpoints: The 'column-rule-outset', 'row-rule-outset',
482
507
column-rule-break: intersection;
483
508
}
484
509
</pre>
485
- <img src="images/example-column-outset-50percent.png">
510
+ <figure>
511
+ <img alt="" src="images/example-column-outset-50percent.png">
486
512
<figcaption>
487
513
An outset of ''50%'' - the initial value - extends each end of a <a>gap decoration</a>
488
514
halfway into its intersection.
@@ -492,6 +518,7 @@ Adjusting gap decoration endpoints: The 'column-rule-outset', 'row-rule-outset',
492
518
and thus the <a>gap decoration</a> does not extend beyond the bounds of the container.
493
519
(Contrast with the previous example, which specified an outset in ''px'' units.)
494
520
</figcaption>
521
+ </figure>
495
522
</div>
496
523
497
524
<div class="example">
@@ -501,11 +528,13 @@ Adjusting gap decoration endpoints: The 'column-rule-outset', 'row-rule-outset',
501
528
column-rule-break: intersection;
502
529
}
503
530
</pre>
504
- <img src="images/example-column-outset-minus-5px.png">
505
- <figcaption>
506
- An outset of ''-5px'' shortens the ends of <a>gap decorations</a>
507
- relative to the edges of adjacent items.
508
- </figcaption>
531
+ <figure>
532
+ <img alt="" src="images/example-column-outset-minus-5px.png">
533
+ <figcaption>
534
+ An outset of ''-5px'' shortens the ends of <a>gap decorations</a>
535
+ relative to the edges of adjacent items.
536
+ </figcaption>
537
+ </figure>
509
538
</div>
510
539
511
540
When considering the <a>gap intersection points</a> within a given gap,
@@ -574,10 +603,12 @@ Gap decoration paint order: The 'rule-paint-order' property {#paint-order}
574
603
column-rule: 6px solid blue;
575
604
}
576
605
</pre>
577
- <img src="images/example-row-over-column.png">
578
- <figcaption>
579
- Row-over-column gap decoration paint order.
580
- </figcaption>
606
+ <figure>
607
+ <img alt="" src="images/example-row-over-column.png">
608
+ <figcaption>
609
+ Row-over-column gap decoration paint order.
610
+ </figcaption>
611
+ </figure>
581
612
</div>
582
613
583
614
<div class="example">
@@ -586,10 +617,12 @@ Gap decoration paint order: The 'rule-paint-order' property {#paint-order}
586
617
row-rule: 6px solid red;
587
618
column-rule: 6px solid blue;
588
619
</pre>
589
- <img src="images/example-column-over-row.png">
590
- <figcaption>
591
- Column-over-row gap decoration paint order.
592
- </figcaption>
620
+ <figure>
621
+ <img alt="" src="images/example-column-over-row.png">
622
+ <figcaption>
623
+ Column-over-row gap decoration paint order.
624
+ </figcaption>
625
+ </figure>
593
626
</div>
594
627
595
628
Color, style, and width {#color-style-width}
0 commit comments