Skip to content

Commit f7a56a8

Browse files
committed
[css-grid] Per WG resolution, switch to using square brackets rather than parens for <line-names>.
1 parent 42c33c9 commit f7a56a8

1 file changed

Lines changed: 21 additions & 23 deletions

File tree

css-grid/Overview.bs

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ Grid Lines</h3>
469469
/* equivalent layout to the prior example, but using named lines */
470470
#grid {
471471
display: grid;
472-
grid-template-columns: 150px (item1-start) 1fr (item1-end);
473-
grid-template-rows: (item1-start) 50px 1fr 50px (item1-end);
472+
grid-template-columns: 150px [item1-start] 1fr [item1-end];
473+
grid-template-rows: [item1-start] 50px 1fr 50px [item1-end];
474474
}
475475

476476
#item1 {
@@ -970,13 +970,10 @@ Track Sizing: the 'grid-template-rows' and 'grid-template-columns' properties</h
970970
<dfn>&lt;track-list></dfn> = [ <<line-names>>? [ <<track-size>> | <<repeat()>> ] ]+ <<line-names>>?
971971
<dfn>&lt;track-size></dfn> = minmax( <<track-breadth>> , <<track-breadth>> ) | <<track-breadth>>
972972
<dfn>&lt;track-breadth></dfn> = <<length>> | <<percentage>> | <<flex>> | min-content | max-content | auto
973-
<dfn>&lt;line-names></dfn> = ( <<custom-ident>>* )
973+
<dfn>&lt;line-names></dfn> = '[' <<custom-ident>>* ']'
974974
<dfn>&lt;line-name-list></dfn> = [ <<line-names>> | repeat([ <<positive-integer>> | auto ], <<line-names>>+) ]+
975975
</pre>
976976

977-
Issue: It's been proposed to use brackets [] instead of parens () for <<line-names>>.
978-
<a href="https://lists.w3.org/Archives/Public/www-style/2015May/0103.html">(see discussion)</a>
979-
980977
Where:
981978

982979
<dl dfn-for="grid-template-columns, grid-template-rows" dfn-type=value>
@@ -1107,8 +1104,8 @@ Named Grid Lines: the <css>(<<custom-ident>>*)</css> syntax</h4>
11071104
&lt;style>
11081105
#grid {
11091106
display: grid;
1110-
grid-template-columns: (first nav) 150px (main) 1fr (last);
1111-
grid-template-rows: (first header) 50px (main) 1fr (footer) 50px (last);
1107+
grid-template-columns: [first nav] 150px [main] 1fr [last];
1108+
grid-template-rows: [first header] 50px [main] 1fr [footer] 50px [last];
11121109
}
11131110
&lt;/style>
11141111
</pre>
@@ -1168,17 +1165,17 @@ Repeating Rows and Columns: the ''repeat()'' notation</h4>
11681165
&lt;style>
11691166
#grid {
11701167
display: grid;
1171-
grid-template-columns: 10px (col-start) 250px (col-end)
1172-
10px (col-start) 250px (col-end)
1173-
10px (col-start) 250px (col-end)
1174-
10px (col-start) 250px (col-end) 10px;
1168+
grid-template-columns: 10px [col-start] 250px [col-end]
1169+
10px [col-start] 250px [col-end]
1170+
10px [col-start] 250px [col-end]
1171+
10px [col-start] 250px [col-end] 10px;
11751172
grid-template-rows: 1fr;
11761173
}
11771174

11781175
/* Equivalent definition. */
11791176
#grid {
11801177
display: grid;
1181-
grid-template-columns: repeat(4, 10px (col-start) 250px (col-end)) 10px;
1178+
grid-template-columns: repeat(4, 10px [col-start] 250px [col-end]) 10px;
11821179
grid-template-rows: 1fr;
11831180
}
11841181
&lt;/style>
@@ -1187,7 +1184,7 @@ Repeating Rows and Columns: the ''repeat()'' notation</h4>
11871184

11881185
If the ''repeat()'' function ends up placing two <<line-names>> adjacent to each other,
11891186
the name lists are merged.
1190-
For example, ''repeat(2, (a) 1fr (b))'' is equivalent to ''(a) 1fr (b a) 1fr (b)''.
1187+
For example, ''repeat(2, [a] 1fr [b])'' is equivalent to ''[a] 1fr [b a] 1fr [b]''.
11911188

11921189
Note: It is expected that a future level of this specification will define a value to be inserted between the repetitions,
11931190
similar to the argument of the <code>Array#join</code> method in JavaScript.
@@ -1370,7 +1367,7 @@ Subgrids: the ''grid-template-rows/subgrid'' keyword</h4>
13701367
<div class="example">
13711368
For example, if the subgrid above were specified with 5 names:
13721369

1373-
<pre>#subgrid { grid-template-columns: subgrid (first) (second) (third) (fourth) (fifth); }</pre>
1370+
<pre>#subgrid { grid-template-columns: subgrid [first] [second] [third] [fourth] [fifth]; }</pre>
13741371

13751372
Items within the subgrid could be positioned using the first four line names;
13761373
the last name would be ignored (as if it didn't exist),
@@ -1424,9 +1421,9 @@ Resolved Values</h4>
14241421
#grid {
14251422
width: 500px;
14261423
grid-template-columns:
1427-
(a) auto
1428-
(b) minmax(min-content, 1fr)
1429-
(b c d) repeat(2, (e) 40px)
1424+
[a] auto
1425+
[b] minmax(min-content, 1fr)
1426+
[b c d] repeat(2, [e] 40px)
14301427
repeat(5, auto);
14311428
}
14321429
&lt;/style>
@@ -1437,7 +1434,7 @@ Resolved Values</h4>
14371434
&lt;script>
14381435
var gridElement = document.getElementById("grid");
14391436
getComputedStyle(gridElement).gridTemplateColumns;
1440-
// (a) 50px (b) 320px (b c d) repeat(2, (e) 40px) repeat(4, 0px) 50px
1437+
// [a] 50px [b] 320px [b c d] repeat(2, [e] 40px) repeat(4, 0px) 50px
14411438
&lt;/script>
14421439
</pre>
14431440
</div>
@@ -1669,15 +1666,15 @@ Explicit Grid Shorthand: the 'grid-template' property</h3>
16691666
<div class='example'>
16701667
<pre>
16711668
grid-template: auto 1fr auto /
1672-
(header-top) "a a a" (header-bottom)
1673-
(main-top) "b b b" 1fr (main-bottom);
1669+
[header-top] "a a a" [header-bottom]
1670+
[main-top] "b b b" 1fr [main-bottom];
16741671
</pre>
16751672

16761673
is equivalent to
16771674

16781675
<pre>
16791676
grid-template-columns: auto 1fr auto;
1680-
grid-template-rows: (header-top) auto (header-bottom main-top) 1fr (main-bottom);
1677+
grid-template-rows: [header-top] auto [header-bottom main-top] 1fr [main-bottom];
16811678
grid-template-areas: "a a a"
16821679
"b b b";
16831680
</pre>
@@ -1866,7 +1863,7 @@ Sizing Auto-generated Rows and Columns: the 'grid-auto-rows' and 'grid-auto-colu
18661863
display: grid;
18671864
/* Define three columns, all content-sized,
18681865
and name the corresponding lines. */
1869-
grid-template-columns: (labels) auto (controls) auto (oversized) auto;
1866+
grid-template-columns: [labels] auto [controls] auto [oversized] auto;
18701867
grid-auto-flow: row;
18711868
}
18721869
form > label {
@@ -3627,6 +3624,7 @@ Changes</h2>
36273624

36283625
* A <a>subgrid</a> now only ignores width/height/alignment constraints in the subgridded dimension(s).
36293626
* Made ''repeat(auto)'' pay attention to max size when it's definite, too.
3627+
* Per WG resolution, switched to using square brackets for <<line-names>>, rather than parentheses.
36303628

36313629

36323630
<h3 id="changes-20140513">

0 commit comments

Comments
 (0)