Skip to content

Commit 35e0a18

Browse files
committed
[css-grid] First draft of 'grid-auto-position'.
1 parent 4646eb1 commit 35e0a18

2 files changed

Lines changed: 50 additions & 6 deletions

File tree

css-grid/Overview.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ <h2 class="no-num no-toc no-ref" id=contents><span class=content>Table of conten
122122
The Implicit Grid</a><ul class=toc><li><a href=#auto-tracks><span class=secno>6.1</span>
123123
Sizing Auto-generated Rows and Columns: the <span class=property data-link-type=propdesc title=grid-auto-rows>grid-auto-rows</span> and <span class=property data-link-type=propdesc title=grid-auto-columns>grid-auto-columns</span> properties</a><li><a href=#grid-auto-flow-property><span class=secno>6.2</span>
124124
Automatic Placement: the <span class=property data-link-type=propdesc title=grid-auto-flow>grid-auto-flow</span> property</a><ul class=toc><li><a href=#auto-placement-algo><span class=secno>6.2.1</span>
125-
Automatic Grid Item Placement Algorithm</a></ul><li><a href=#implicit-grid-shorthand><span class=secno>6.3</span>
125+
Automatic Grid Item Placement Algorithm</a></ul><li><a href=#grid-auto-position-property><span class=secno>6.3</span>
126+
Automatic Placement: the <span class=property data-link-type=propdesc title=grid-auto-position>grid-auto-position</span> property</a><li><a href=#implicit-grid-shorthand><span class=secno>6.4</span>
126127
Implicit Grid Shorthand: the <span class=property data-link-type=propdesc title=grid-auto>grid-auto</span> property</a></ul><li><a href=#placement><span class=secno>7</span>
127128
Placing Grid Items</a><ul class=toc><li><a href=#line-placement><span class=secno>7.1</span>
128129
Line-based Placement: the <span class=property data-link-type=propdesc title=grid-row-start>grid-row-start</span>, <span class=property data-link-type=propdesc title=grid-column-start>grid-column-start</span>, <span class=property data-link-type=propdesc title=grid-row-end>grid-row-end</span>, and <span class=property data-link-type=propdesc title=grid-column-end>grid-column-end</span> properties</a><li><a href=#placement-shorthands><span class=secno>7.2</span>
@@ -1422,15 +1423,15 @@ <h3 data-level=6.2 id=grid-auto-flow-property><span class=secno>6.2 </span><span
14221423

14231424
<table class=propdef><tr><th>Name:<td><dfn data-dfn-type=property data-export="" id=propdef-grid-auto-flow>grid-auto-flow</dfn><tr><th>Value:<td>none | [ [ rows | columns ] &amp;&amp; dense? ]<tr><th>Initial:<td>rows<tr><th>Applies to:<td><a href=#grid-container>grid containers</a><tr><th>Inherited:<td>no<tr><th>Percentages:<td>n/a<tr><th>Media:<td>visual<tr><th>Computed value:<td>specified value</table>
14241425
<p>
1425-
<a href=#grid-item>Grid items</a> that aren't explicitly placed are are automatically placed into an unoccupied space in the <a href=#grid-container>grid container</a>.
1426+
<a href=#grid-item>Grid items</a> that aren't explicitly placed are automatically placed into an unoccupied space in the <a href=#grid-container>grid container</a>.
14261427
The <a class=property data-link-type=propdesc href=#propdef-grid-auto-flow title=grid-auto-flow>grid-auto-flow</a> property controls the direction in which the search for unoccupied space takes place,
14271428
and whether rows or columns are added as needed to accommodate the content.
14281429

14291430
<dl data-dfn-for=grid-auto-flow data-dfn-type=value>
14301431
<dt><dfn data-dfn-for=grid-auto-flow data-dfn-type=value data-export="" id=valuedef-none>none</dfn>
14311432
<dd>
14321433
Rather than use the auto-placement algorithm,
1433-
auto-placed <a href=#grid-item>grid items</a> are simply positioned according to the <a class=property data-link-type=propdesc title=grid-auto-position>grid-auto-position</a> property.
1434+
auto-placed <a href=#grid-item>grid items</a> are simply positioned according to the <a class=property data-link-type=propdesc href=#propdef-grid-auto-position title=grid-auto-position>grid-auto-position</a> property.
14341435

14351436
<dt><dfn data-dfn-for=grid-auto-flow data-dfn-type=value data-export="" id=valuedef-rows>rows</dfn>
14361437
<dd>
@@ -1603,7 +1604,23 @@ <h4 data-level=6.2.1 id=auto-placement-algo><span class=secno>6.2.1 </span><span
16031604
<p class=issue>
16041605
Edit the algorithm to allow for dense packing.
16051606

1606-
<h3 data-level=6.3 id=implicit-grid-shorthand><span class=secno>6.3 </span><span class=content>
1607+
<h3 data-level=6.3 id=grid-auto-position-property><span class=secno>6.3 </span><span class=content>
1608+
Automatic Placement: the <a class=property data-link-type=propdesc href=#propdef-grid-auto-position title=grid-auto-position>grid-auto-position</a> property</span><a class=section-link href=#grid-auto-position-property>§</a></h3>
1609+
1610+
<table class=propdef><tr><th>Name:<td><dfn data-dfn-type=property data-export="" id=propdef-grid-auto-position>grid-auto-position</dfn><tr><th>Value:<td><a class=production data-link-type=type href=#typedef-grid-line>&lt;grid-line&gt;</a> / <a class=production data-link-type=type href=#typedef-grid-line>&lt;grid-line&gt;</a><tr><th>Initial:<td>1 / 1<tr><th>Applies to:<td><a href=#grid-container>grid containers</a><tr><th>Inherited:<td>no<tr><th>Percentages:<td>na/<tr><th>Media:<td>visual<tr><th>Computed value:<td>specified value</table>
1611+
<p> If a <a href=#grid-container>grid container</a> doesn't specify an automatic-placement strategy through <a class=property data-link-type=propdesc href=#propdef-grid-auto-flow title=grid-auto-flow>grid-auto-flow</a>,
1612+
any grid items with an <a href=#automatic0>automatic grid position</a> are instead all placed at the default position
1613+
specified by <a class=property data-link-type=propdesc href=#propdef-grid-auto-position title=grid-auto-position>grid-auto-position</a>.
1614+
1615+
<p> Interpret the two <a class=production data-link-type=type href=#typedef-grid-line>&lt;grid-line&gt;</a>s as if they were specified in <a class=property data-link-type=propdesc href=#propdef-grid-column-start title=grid-column-start>grid-column-start</a> and <a class=property data-link-type=propdesc href=#propdef-grid-row-start title=grid-row-start>grid-row-start</a>, respectively,
1616+
of a hypothetical <a href=#grid-item>grid item</a>,
1617+
treating <a class=css data-link-type=maybe href=#valuedef-auto>auto</a> as <span class=css data-link-type=maybe>1</span> for this purpose.
1618+
The resulting lines of the <a href=#grid-container>grid container</a>
1619+
become a <a href=#definite0>definite grid position</a> in both axises
1620+
for the auto-placed <a href=#grid-item>grid items</a>.
1621+
1622+
1623+
<h3 data-level=6.4 id=implicit-grid-shorthand><span class=secno>6.4 </span><span class=content>
16071624
Implicit Grid Shorthand: the <a class=property data-link-type=propdesc href=#propdef-grid-auto title=grid-auto>grid-auto</a> property</span><a class=section-link href=#implicit-grid-shorthand>§</a></h3>
16081625

16091626
<table class=propdef><tr><th>Name:<td><dfn data-dfn-type=property data-export="" id=propdef-grid-auto>grid-auto</dfn><tr><th>Value:<td><a class=production data-link-type=propdesc href=#propdef-grid-auto-flow title=grid-auto-flow>&lt;‘grid-auto-flow’&gt;</a> || [ <a class=production data-link-type=propdesc href=#propdef-grid-auto-columns title=grid-auto-columns>&lt;‘grid-auto-columns’&gt;</a> [ / <a class=production data-link-type=propdesc href=#propdef-grid-auto-rows title=grid-auto-rows>&lt;‘grid-auto-rows’&gt;</a> ]? ]<tr><th>Initial:<td>see individual properties<tr><th>Applies to:<td><a href=#grid-container>grid containers</a><tr><th>Inherited:<td>see individual properties<tr><th>Percentages:<td>see individual properties<tr><th>Media:<td>visual<tr><th>Computed value:<td>see individual properties</table>
@@ -2807,6 +2824,7 @@ <h2 class="no-num no-ref" id=property-index><span class=content>
28072824
<tr><th scope=row><a data-property="">grid-auto-columns</a><td><a class=production data-link-type=type href=#typedef-track-size>&lt;track-size&gt;</a><td>auto<td><td>no<td>see <a href=#track-sizing>Track Sizing</a><td>visual<td><a href=#grid-container>grid containers</a><td>see <a href=#track-sizing>Track Sizing</a><td>
28082825
<tr><th scope=row><a data-property="">grid-auto-rows</a><td><a class=production data-link-type=type href=#typedef-track-size>&lt;track-size&gt;</a><td>auto<td><td>no<td>see <a href=#track-sizing>Track Sizing</a><td>visual<td><a href=#grid-container>grid containers</a><td>see <a href=#track-sizing>Track Sizing</a><td>
28092826
<tr><th scope=row><a data-property="">grid-auto-flow</a><td>none | [ [ rows | columns ] &amp;&amp; dense? ]<td>rows<td><td>no<td>n/a<td>visual<td><a href=#grid-container>grid containers</a><td>specified value<td>
2827+
<tr><th scope=row><a data-property="">grid-auto-position</a><td><a class=production data-link-type=type href=#typedef-grid-line>&lt;grid-line&gt;</a> / <a class=production data-link-type=type href=#typedef-grid-line>&lt;grid-line&gt;</a><td>1 / 1<td><td>no<td>na/<td>visual<td><a href=#grid-container>grid containers</a><td>specified value<td>
28102828
<tr><th scope=row><a data-property="">grid-auto</a><td><a class=production data-link-type=propdesc href=#propdef-grid-auto-flow title=grid-auto-flow>&lt;‘grid-auto-flow’&gt;</a> || [ <a class=production data-link-type=propdesc href=#propdef-grid-auto-columns title=grid-auto-columns>&lt;‘grid-auto-columns’&gt;</a> [ / <a class=production data-link-type=propdesc href=#propdef-grid-auto-rows title=grid-auto-rows>&lt;‘grid-auto-rows’&gt;</a> ]? ]<td>see individual properties<td><td>see individual properties<td>see individual properties<td>visual<td><a href=#grid-container>grid containers</a><td>see individual properties<td>
28112829
<tr><th scope=row><a data-property="">grid-row-start</a><td><a class=production data-link-type=type href=#typedef-grid-line>&lt;grid-line&gt;</a><td>auto<td><td>no<td>n/a<td>visual<td><a href=#grid-item>grid items</a><td>specified value (almost)<td>
28122830
<tr><th scope=row><a data-property="">grid-column-start</a><td><a class=production data-link-type=type href=#typedef-grid-line>&lt;grid-line&gt;</a><td>auto<td><td>no<td>n/a<td>visual<td><a href=#grid-item>grid items</a><td>specified value (almost)<td>

css-grid/Overview.src.html

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>CSS Grid Layout Module Level 1</h1>
1515
Previous editors: <a href="mailto:pcupp@microsoft.com">Phil Cupp</a>, Microsoft Corporation
1616
Issues list: <a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&amp;component=Grid+Layout&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">In Bugzilla</a>
1717
Abstract: This CSS module defines a two-dimensional grid-based layout system, optimized for user interface design. In the grid layout model, the children of a grid container can be positioned into arbitrary slots in a flexible or fixed predefined layout grid.
18-
Ignored Terms: column-*, justify-*, containing block, grid-field, <positive-integer>, <ident>, auto, grid-auto-position
18+
Ignored Terms: column-*, justify-*, containing block, grid-field, <positive-integer>, <ident>, auto
1919
Link Defaults: css21 (property) margin, css-align-3 (dfn) alignment container/alignment subject
2020
</pre>
2121

@@ -1412,7 +1412,7 @@ <h3 id="grid-auto-flow-property">
14121412
</pre>
14131413

14141414
<p>
1415-
<a>Grid items</a> that aren't explicitly placed are are automatically placed into an unoccupied space in the <a>grid container</a>.
1415+
<a>Grid items</a> that aren't explicitly placed are automatically placed into an unoccupied space in the <a>grid container</a>.
14161416
The 'grid-auto-flow' property controls the direction in which the search for unoccupied space takes place,
14171417
and whether rows or columns are added as needed to accommodate the content.
14181418

@@ -1595,6 +1595,32 @@ <h4 id='auto-placement-algo'>
15951595
<p class='issue'>
15961596
Edit the algorithm to allow for dense packing.
15971597

1598+
<h3 id="grid-auto-position-property">
1599+
Automatic Placement: the 'grid-auto-position' property</h3>
1600+
1601+
<pre class='propdef'>
1602+
Name: grid-auto-position
1603+
Value: <<grid-line>> / <<grid-line>>
1604+
Initial: 1 / 1
1605+
Applies to: <a>grid containers</a>
1606+
Inherited: no
1607+
Percentages: na/
1608+
Media: visual
1609+
Computed value: specified value
1610+
</pre>
1611+
1612+
If a <a>grid container</a> doesn't specify an automatic-placement strategy through 'grid-auto-flow',
1613+
any grid items with an <a>automatic grid position</a> are instead all placed at the default position
1614+
specified by 'grid-auto-position'.
1615+
1616+
Interpret the two <<grid-line>>s as if they were specified in 'grid-column-start' and 'grid-row-start', respectively,
1617+
of a hypothetical <a>grid item</a>,
1618+
treating ''auto'' as ''1'' for this purpose.
1619+
The resulting lines of the <a>grid container</a>
1620+
become a <a>definite grid position</a> in both axises
1621+
for the auto-placed <a>grid items</a>.
1622+
1623+
15981624
<h3 id='implicit-grid-shorthand'>
15991625
Implicit Grid Shorthand: the 'grid-auto' property</h3>
16001626

0 commit comments

Comments
 (0)