Skip to content

Commit 903a7c9

Browse files
committed
[css-grid] Clarifications to subgrid
1 parent f9a9b51 commit 903a7c9

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

css-grid/Overview.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,21 +1092,31 @@ <h4 data-level=5.1.4 id=subgrids><span class=secno>5.1.4 </span><span class=cont
10921092
<li>
10931093
The <a href=#subgrid>subgrid</a>'s own grid items participate in the sizing of its parent grid and are aligned to it.
10941094
In this process, the sum of the item's margin, padding, and borders are applied as an extra layer of margin to the items at those edges.
1095+
However, any overflow tracks
1096+
(i.e. those outside the <a href=#explicit-grid>explicit grid</a> when the <a href=#subgrid>subgrid</a> has a <a href=#definite>definite grid span</a>)
1097+
do not correspond to any tracks in the parent grid;
1098+
they effectively extend in a third dimension.
1099+
(For example, if a parent grid has adjacent tracks <var>A</var>, <var>B</var>, and <var>C</var>,
1100+
and a <span class=css data-link-type=maybe>span 1</span> subgrid with an extra <a href=#implicit-grid-tracks>implicit grid track</a> is placed in track <var>B</var>,
1101+
the items in that <a href=#implicit-grid-tracks>implicit grid track</a> are not considered part of track <var>B</var>.)
10951102

10961103
<li>
10971104
The <a href=#subgrid>subgrid</a> is always stretched;
10981105
the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-align-3/#align-self title=align-self>align-self</a>/<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-align-3/#justify-self title=justify-self>justify-self</a> properties on it are ignored.
10991106
Any specified width/height constraints are also ignored.
11001107

11011108
<li>
1102-
The <a href=#subgrid>subgrid</a>’s <a href=#explicit-grid>explicit grid</a> is always aligned with the corresponding section of the parent <a href=#grid>grid</a>;
1109+
Layoutwise, the <a href=#subgrid>subgrid</a>’s <a href=#explicit-grid>explicit grid</a> is always aligned with the corresponding section of the parent <a href=#grid>grid</a>;
11031110
the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-align-3/#align-content title=align-content>align-content</a>/<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-align-3/#justify-content title=justify-content>justify-content</a> properties on it are ignored.
1111+
However, <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-overflow-3/#overflow title=overflow>overflow</a> does apply,
1112+
so the contents of the subgrid can be scrolled aside.
1113+
(Scrolling does not affect layout.)
11041114

11051115
<li>
11061116
Explicit named lines can also be specified together with the <a data-link-type=value href=#valuedef-subgrid>subgrid</a> keyword;
11071117
these names apply to the corresponding lines taken from the parent <a href=#grid>grid</a>.
11081118
If the <a href=#subgrid>subgrid</a> has an explicit <a href=#grid-span>grid span</a>,
1109-
any names for lines beyond the span are ignored.
1119+
any names specified for lines beyond the span are ignored.
11101120
If the <a href=#subgrid>subgrid</a> has an explicit <a href=#grid-position>grid position</a> as well as an explicit <a href=#grid-span>grid span</a>,
11111121
it also automatically receives the names of the lines that it covers in its parent <a href=#grid>grid</a>.
11121122
</ul>

css-grid/Overview.src.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,21 +1024,31 @@ <h4 id="subgrids">
10241024
<li>
10251025
The <a>subgrid</a>'s own grid items participate in the sizing of its parent grid and are aligned to it.
10261026
In this process, the sum of the item's margin, padding, and borders are applied as an extra layer of margin to the items at those edges.
1027+
However, any overflow tracks
1028+
(i.e. those outside the <i>explicit grid</i> when the <i>subgrid</i> has a <i>definite grid span</i>)
1029+
do not correspond to any tracks in the parent grid;
1030+
they effectively extend in a third dimension.
1031+
(For example, if a parent grid has adjacent tracks <var>A</var>, <var>B</var>, and <var>C</var>,
1032+
and a ''span 1'' subgrid with an extra <i>implicit grid track</i> is placed in track <var>B</var>,
1033+
the items in that <i>implicit grid track</i> are not considered part of track <var>B</var>.)
10271034

10281035
<li>
10291036
The <a>subgrid</a> is always stretched;
10301037
the 'align-self'/'justify-self' properties on it are ignored.
10311038
Any specified width/height constraints are also ignored.
10321039

10331040
<li>
1034-
The <a>subgrid</a>’s <a>explicit grid</a> is always aligned with the corresponding section of the parent <a>grid</a>;
1041+
Layoutwise, the <a>subgrid</a>’s <a>explicit grid</a> is always aligned with the corresponding section of the parent <a>grid</a>;
10351042
the 'align-content'/'justify-content' properties on it are ignored.
1043+
However, 'overflow' does apply,
1044+
so the contents of the subgrid can be scrolled aside.
1045+
(Scrolling does not affect layout.)
10361046

10371047
<li>
10381048
Explicit named lines can also be specified together with the <a value>subgrid</a> keyword;
10391049
these names apply to the corresponding lines taken from the parent <a>grid</a>.
10401050
If the <a>subgrid</a> has an explicit <a>grid span</a>,
1041-
any names for lines beyond the span are ignored.
1051+
any names specified for lines beyond the span are ignored.
10421052
If the <a>subgrid</a> has an explicit <a>grid position</a> as well as an explicit <a>grid span</a>,
10431053
it also automatically receives the names of the lines that it covers in its parent <a>grid</a>.
10441054
</ul>

0 commit comments

Comments
 (0)