Skip to content

Commit 4cbe692

Browse files
committed
[css-grid-2] Add back subgrid-local line names (which we had elided for simplicity of discussion over per-axis vs dual-axis proposals). #2280 #2622
1 parent cfba57e commit 4cbe692

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

css-grid-2/Overview.bs

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,44 @@ Establishing a Subgrid: Per-Axis Proposal</h3>
9292

9393
<pre class="propdef">
9494
Name: grid-template-rows, grid-template-columns
95-
New values: subgrid
95+
New values: subgrid <<line-name-list>>?
9696
</pre>
9797

9898
<dl dfn-for="grid-template-rows, grid-template-columns" dfn-type=value>
99-
<dt><dfn>subgrid</dfn>
99+
<dt><dfn id="subgrid-listing">subgrid <<line-name-list>>?</dfn>
100100
<dd>
101-
Tracks are <a>subgridded</a> in this axis:
102-
the tracks are adopted from the the parent grid tracks that it spans.
103-
If there is no parent grid, equivalent to
101+
The <dfn value for="grid-template-rows, grid-template-columns">subgrid</dfn> value
102+
indicates that the grid will adopt the spanned portion of its parent grid in that axis.
103+
Rather than being specified explicitly,
104+
the sizes of the grid rows/columns
105+
will be taken from the parent grid's definition.
106+
107+
The <<line-name-list>> argument allows local naming of the grid lines propagated from the parent grid:
108+
if a <<line-name-list>> is given,
109+
the specified <<line-names>>s are assigned to the subgrid’s <a>explicit grid lines</a>,
110+
one per line, starting with line 1.
111+
Excess <<line-names>> are ignored.
112+
113+
If there is no parent grid,
114+
this value is equivalent to
104115
the initial value, ''grid-template-rows/none''.
105116
</dl>
106117

107-
Issue: Add back syntax for overlaying line names.
118+
The syntax of <<line-name-list>> is defined as follows:
119+
120+
<pre class="prod">
121+
<dfn>&lt;line-name-list></dfn> = [ <<line-names>> | <<name-repeat>> ]+
122+
<dfn>&lt;line-names></dfn> = '[' <<custom-ident>>* ']'
123+
<dfn>&lt;name-repeat></dfn> = repeat( [ <positive-integer> | auto-fill ], <line-names>+)
124+
</pre>
125+
126+
The <<name-repeat>> variant of the ''repeat()'' notation
127+
<!-- is for adding line names to <a href="#subgrids">subgrids</a> and -->
128+
can only be used with the ''grid-template-rows/subgrid'' keyword:
129+
it only repeats names.
130+
The ''auto-fill'' keyword is only valid once per <<line-name-list>>,
131+
and repeats enough times for the name list to match the subgrid’s specified <a>grid span</a>
132+
(falling back to 0 if the span is already fulfilled).
108133

109134
<h3 id="subgrid-items">
110135
Characteristics of a Subgrid Item</h3>
@@ -116,6 +141,7 @@ Characteristics of a Subgrid Item</h3>
116141
The number of explicit tracks in each subgridded dimension
117142
is given by its <a>grid span</a> in that dimension,
118143
rather than by 'grid-template-rows'/'grid-template-columns'.
144+
The track sizes are governed by the parent grid.
119145

120146
<li>
121147
The <a>grid-placement properties</a> of the <a>subgrid</a>’s <a>grid items</a>
@@ -128,6 +154,11 @@ Characteristics of a Subgrid Item</h3>
128154
the subgridded lines
129155
automatically receive the line names specified on the parent <a>grid</a>.
130156

157+
ISSUE: If a <<line-name-list>> is provided,
158+
should this hide the names received from the parent
159+
or be in addition to those names?
160+
(<a href="https://github.com/w3c/csswg-drafts/issues/2622">Issue 2622</a>)
161+
131162
<li>
132163
The <a>subgrid</a> itself lays out as an ordinary <a>grid item</a> in its parent grid,
133164
but acts as if it was completely empty for sizing purposes

0 commit comments

Comments
 (0)