@@ -151,6 +151,19 @@ Layout and painting {#layout-painting}
151
151
</figcaption>
152
152
</div>
153
153
154
+ Note: [[CSS-ALIGN-3#column-row-gap]] defines
155
+ cross-direction gaps in flex containers
156
+ as being between adacent flex items in a single line.
157
+ Thus, in the example above,
158
+ even though the right edges of #4 and #7 line up,
159
+ and the left edges of #5 and #8 line up,
160
+ the spaces between those two pairs of items are <em> two distinct gaps</em>
161
+ since they are on different lines.
162
+ Therefore, the intersection between #4, #5, #7, and #8
163
+ contains two <a>gap intersection points</a> whose locations coincide:
164
+ one at the bottom of the gap between #4 and #5,
165
+ and one at the top of the gap between #7 and #8.
166
+
154
167
<a>Gap decorations</a> are painted relative to pairs of <a>gap intersection points</a> ,
155
168
in the center of the corresponding gap and parallel to its edges.
156
169
@@ -305,42 +318,103 @@ Breaking gap decorations into segments: The 'column-rule-break', 'row-rule-break
305
318
306
319
<div class="example">
307
320
<pre>
308
- .break-intersection {
309
- rule-break: intersection;
321
+ .break-none-grid {
322
+ display: grid;
323
+ grid-template: repeat(4, 100px) / repeat(4, 100px);
324
+ gap: 20px;
325
+ row-rule: 6px solid red;
326
+ column-rule: 6px solid blue;
327
+ rule-break: none;
310
328
rule-outset: 0px;
311
329
}
312
330
</pre>
313
- <img src="images/example-break-intersection .png">
331
+ <img src="images/example-break-none-grid .png">
314
332
<figcaption>
315
- <a>Gap decorations</a> broken at every <a>gap intersection point</a> .
333
+ Grid <a>gap decorations</a> with no breaks.
334
+ Note that the <a>gap decorations</a> extend "behind" items placed in the grid.
316
335
</figcaption>
317
336
</div>
318
337
319
338
<div class="example">
320
339
<pre>
321
- .break-spanning-item {
340
+ .break-spanning-item-grid {
341
+ display: grid;
342
+ grid-template: repeat(4, 100px) / repeat(4, 100px);
343
+ gap: 20px;
344
+ row-rule: 6px solid red;
345
+ column-rule: 6px solid blue;
322
346
rule-break: spanning-item;
323
347
rule-outset: 0px;
324
348
}
325
349
</pre>
326
- <img src="images/example-break-spanning-item.png">
350
+ <img src="images/example-break-spanning-item-grid .png">
327
351
<figcaption>
328
- <a>Gap decorations</a> broken at <a>gap intersection points</a>
329
- that are not adjacent to a spanning item .
352
+ Grid <a>gap decorations</a> broken at <a>gap intersection points</a>
353
+ that are not adjacent to spanning items .
330
354
</figcaption>
331
355
</div>
332
356
333
357
<div class="example">
334
358
<pre>
335
- .break-none {
359
+ .break-intersection-grid {
360
+ display: grid;
361
+ grid-template: repeat(4, 100px) / repeat(4, 100px);
362
+ gap: 20px;
363
+ row-rule: 6px solid red;
364
+ column-rule: 6px solid blue;
365
+ rule-break: intersection;
366
+ rule-outset: 0px;
367
+ }
368
+ </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>
374
+ </div>
375
+
376
+ <div class="example">
377
+ <pre>
378
+ .break-none-flex {
379
+ display: flex;
380
+ flex-wrap: wrap;
381
+ gap: 20px;
382
+ row-rule: 6px solid red;
383
+ column-rule: 6px solid blue;
336
384
rule-break: none;
337
385
rule-outset: 0px;
338
386
}
339
387
</pre>
340
- <img src="images/example-break-none.png">
388
+ <img src="images/example-break-none-flex .png">
341
389
<figcaption>
342
- <a>Gap decorations</a> with no breaks.
343
- Note that the <a>gap decorations</a> extend "behind" items placed in the grid.
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>
395
+ </div>
396
+
397
+ Note: Because flexbox has no concept of spanning items,
398
+ ''column-rule-break/spanning-item'' on a flexbox has the same effect as
399
+ ''column-rule-break/none'' .
400
+
401
+ <div class="example">
402
+ <pre>
403
+ .break-intersection-flex {
404
+ display: flex;
405
+ flex-wrap: wrap;
406
+ gap: 20px;
407
+ width: 500px;
408
+ gap: 20px;
409
+ row-rule: 6px solid red;
410
+ column-rule: 6px solid blue;
411
+ rule-break: intersection;
412
+ rule-outset: 0px;
413
+ }
414
+ </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> .
344
418
</figcaption>
345
419
</div>
346
420
0 commit comments