Skip to content

Commit 367b9f5

Browse files
stwrtfantasai
authored andcommitted
[css-grid-3] Update CSS-Grid-3 spec to use new grid-lanes syntax
w3c#12022 resolved to declaring masonry using display: grid-lanes. We need to update the spec to match.
1 parent 02bd88b commit 367b9f5

12 files changed

Lines changed: 39 additions & 45 deletions

css-grid-3/Overview.bs

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Reordering and Accessibility</h3>
297297
</section>
298298
<style>
299299
.masonry {
300-
//FIXME display: something;
300+
display: grid-lanes;
301301
grid-template-columns: repeat(5, auto);
302302
}
303303
.item { height: 50px; }
@@ -348,28 +348,25 @@ Reordering and Accessibility</h3>
348348
<h3 id="masonry-switch">
349349
Establishing Masonry Layout</h3>
350350

351-
<div class="informative">
352-
<pre class="propdef partial">
353-
Name: display
354-
New values: something
355-
</pre>
356-
</div>
351+
<pre class="propdef partial">
352+
Name: display
353+
New values: grid-lanes | inline-grid-lanes
354+
</pre>
357355

358356
<dl dfn-for="display" dfn-type=value>
359-
<dt><dfn>something</dfn>
357+
<dt><dfn>grid-lanes</dfn>
358+
<dd>
359+
This value causes an element to generate a [=block-level=] [=masonry container=] box.
360+
361+
<dt><dfn>inline-grid-lanes</dfn>
360362
<dd>
361-
This value causes an element to generate a <a>masonry container</a> box.
363+
This value causes an element to generate an [=inline-level=] [=masonry container=] box.
362364
</dl>
363365

364366
A [=masonry container=] that is not [=subgridded=] in its [=grid axis=] establishes
365367
an [=independent formatting context=]
366368
for its contents.
367369

368-
<div class=issue>
369-
ISSUE(12022): We are looking for a reasonable 'display' value (that includes the word ''display/grid'' somehow) to represent [=masonry layout=].
370-
They could be of the form <css>something-grid</css>, <css>grid-something</css>, <css>grid something</css>, or <css>something grid</css>.
371-
Suggestions are welcome in the issue.
372-
</div>
373370

374371
<div class=issue>
375372
ISSUE(12820): Write up how grid/masonry formatting contexts work more formally?
@@ -497,11 +494,9 @@ Subgrids</h3>
497494
the subgridded axis is taken from the parent container
498495
[[css-grid-2#subgrids|as specified for grid containers]];
499496
if the parent's corresponding axis is a [=stacking axis=],
500-
the subgridded axis acts like ''masonry''.
497+
the subgridded axis also acts as a [=stacking axis=].
501498

502-
Note: If this results in ''grid-template/masonry'' in both axes,
503-
it is resolved as normal for [=masonry containers=] with double-axis ''grid-template/masonry'' templates,
504-
i.e. it acts like ''grid-template-columns: none; grid-template-rows: masonry''.
499+
ISSUE: What if this conflicts with the masonry orientation, or results in both axes stacking?
505500

506501
In [=masonry layout=], auto-placed [=subgrids=]
507502
don't inherit any line names from their parent grid,
@@ -515,7 +510,7 @@ Subgrids</h3>
515510
```css
516511
<style>
517512
.grid {
518-
//FIXME: display: inline something;
513+
display: inline-grid-lanes;
519514
grid-template-rows: auto auto 100px;
520515
align-content: center;
521516
height: 300px;
@@ -956,7 +951,7 @@ Placement and Writing Modes</h4>
956951
```css
957952
<style>
958953
.grid {
959-
//FIXME display: inline something;
954+
display: inline-grid-lanes;
960955
direction: rtl;
961956
grid-template-columns: repeat(4, 2ch);
962957
border: 1px solid;
@@ -991,7 +986,7 @@ Placement and Writing Modes</h4>
991986
```css
992987
<style>
993988
.grid {
994-
//FIXME display: inline something;
989+
display: inline-grid-lanes;
995990
direction: rtl;
996991
width: 10ch;
997992
column-gap: 1ch;
@@ -1036,7 +1031,7 @@ Sizing Grid Containers</h2>
10361031
```css
10371032
<style>
10381033
.grid {
1039-
//FIXME display: inline something;
1034+
display: inline-grid-lanes;
10401035
grid-template-columns: 50px 100px auto;
10411036
grid-gap: 10px;
10421037
border: 1px solid;
@@ -1207,7 +1202,7 @@ Graceful Degradation</h2>
12071202

12081203
```css
12091204
display: grid;
1210-
display: something; /* ignored in UAs that don't support masonry layout */
1205+
display: grid-lanes; /* ignored in UAs that don't support masonry layout */
12111206
grid-template-columns: 150px 100px 50px;
12121207
```
12131208

css-grid-3/examples/fragmentation-block-axis-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111

1212
.grid {
13-
display: grid;
14-
grid: masonry / 100px auto 100px;
13+
display: grid-lanes;
14+
grid-template-columns: 100px auto 100px;
1515
border: 1px solid;
1616
gap: 10px;
1717
}

css-grid-3/examples/fragmentation-inline-axis-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111

1212
.grid {
13-
display: grid;
14-
grid: 20px auto 30px / masonry;
13+
display: grid-lanes;
14+
grid-template-rows: 20px auto 30px;
1515
border: 1px solid;
1616
gap: 10px;
1717
}

css-grid-3/examples/graceful-degradation-example.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
-->
66
<style>
77
.grid {
8-
display: inline-grid;
9-
grid-template-rows: masonry;
8+
display: inline-grid-lanes;
109
grid-template-columns: 150px 100px 50px;
1110
gap: 3px;
1211
padding: 10px;

css-grid-3/examples/grid-intrinsic-sizing-example-1.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!DOCTYPE html>
22
<style>
33
.grid {
4-
display: inline-grid;
5-
grid: masonry / 50px 100px auto;
4+
display: inline-grid-lanes;
5+
grid-template-columns: 50px 100px auto;
66
grid-gap: 10px;
77
border: 1px solid;
88
}

css-grid-3/examples/justify-tracks-example-1.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
-->
66
<style>
77
.grid {
8-
display: inline-grid;
9-
grid: 150px 100px 50px / masonry;
8+
display: inline-grid-lanes;
9+
grid-template-rows: 150px 100px 50px;
1010
gap: 3px;
1111
padding: 10px;
1212
border: 3px solid;

css-grid-3/examples/masonry-auto-flow-next.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
<style>
1313
.grid {
14-
display: inline-grid;
15-
grid: masonry / repeat(3, 2ch);
14+
display: inline-grid-lanes;
15+
grid-template-columns: repeat(3, 2ch);
1616
border: 1px solid;
1717
masonry-auto-flow: next;
1818
}

css-grid-3/examples/masonry-axis-baseline-alignment-1.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
}
1010

1111
.grid {
12-
display: inline-grid;
13-
grid: masonry / repeat(10,auto);
12+
display: inline-grid-lanes;
13+
grid-template-columns: repeat(10,auto);
1414
gap: 3px 1px;
1515
border: 2px solid;
1616
height: 400px;

css-grid-3/examples/pinterest-with-span.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
<style>
1313
.grid {
14-
display: inline-grid;
15-
grid: masonry / repeat(3, 200px);
14+
display: inline-grid-lanes;
15+
grid-template-columns: repeat(3, 200px);
1616
background: black;
1717
}
1818

css-grid-3/examples/rtl-grid-axis.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
<style>
1313
.grid {
14-
display: inline-grid;
14+
display: inline-grid-lanes;
1515
direction: rtl;
16-
grid: masonry / repeat(4, 2ch);
16+
grid-template-columns: repeat(4, 2ch);
1717
border: 1px solid;
1818
}
1919

0 commit comments

Comments
 (0)