8000 [css3-layout] Added 'grid-auto' property as alternative to keyword · xfq/csswg-drafts@ee4c092 · GitHub
Skip to content

Commit ee4c092

Browse files
committed
[css3-layout] Added 'grid-auto' property as alternative to keyword
'next'. Mentioned need for specifying size of automatically added rows and columns. Fixed typos: removed mention of 'next' under 'flow', changed occurrence of 'grid-value' to 'grid-area'. --HG-- extra : rebase_source : 1065a9b46fd370a5234aea1e681bfce34e8c308b
1 parent 3624d3e commit ee4c092

1 file changed

Lines changed: 87 additions & 10 deletions

File tree

css-template/Overview.src.html

Lines changed: 87 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ <h3 id=flow>Flowing content into slots: 'flow'</h3>
17901790
<p>The name of the slot may be quoted (<var>&lt;string&gt;</var>) or
17911791
unquoted (<var>&lt;identifier&gt;</var>), but if the name is equal to
17921792
one of the following, it <em>must</em> be quoted: ''initial'',
1793-
''inherit'', ''default'', ''same'', or ''next''. This is to avoid
1793+
''inherit'', ''default'' or ''same''. This is to avoid
17941794
ambiguity with the keywords of the same name.
17951795

17961796
<div class=example>
@@ -2152,7 +2152,7 @@ <h3 id=flow>Flowing content into slots: 'flow'</h3>
21522152

21532153
<!--=================================================================-->
21542154

2155-
<h3>Stacking elements on top of a grid: 'grid-area'</h3>
2155+
<h3>Stacking elements on top of a grid: 'grid-area' and 'grid-auto'</h3>
21562156

21572157
<table class=propdef>
21582158
<tbody>
@@ -2174,6 +2174,23 @@ <h3>Stacking elements on top of a grid: 'grid-area'</h3>
21742174
value definition">per grammar</abbr>
21752175
</table>
21762176

2177+
<table class=propdef>
2178+
<tbody>
2179+
<tr><th>Name: <td><dfn>grid-auto</dfn>
2180+
<tr><th><a href="#values" >Value</a>: <td>none | rows | columns
2181+
<tr><th>Initial: <td>none
2182+
<tr><th>Applies to: <td>elements that have a <span>grid
2183+
ancestor</span> and whose 'position' is equal to 'static' or
2184+
'relative'
2185+
<tr><th>Inherited: <td>yes
2186+
<tr><th>Animatable: <td>no
2187+
<tr><th>Percentages: <td>N/A
2188+
<tr><th>Media: <td>visual
2189+
<tr><th>Computed&nbsp;value: <td>specified value
2190+
<tr><th>Canonical order: <td><abbr title="follows order of property
2191+
value definition">per grammar</abbr>
2192+
</table>
2193+
21772194
<div class=issue>
21782195
<p>At the Aug 2012 ftf, Florian suggested a property 'collision: auto
21792196
| collide | avoid' to switch between overlapping and not overlapping.
@@ -2223,11 +2240,11 @@ <h3>Stacking elements on top of a grid: 'grid-area'</h3>
22232240

22242241
<dt>auto
22252242
<dd>
2226-
<p class=issue>The automatic placement algorithm: selects the next
2227-
slot (scanning either left to right and top to bottom, or top to
2228-
bottom and left to right, see the '??' property) that doesn't have an
2229-
earlier element positioned with 'grid-area'. If no such slot, then add
2230-
another row or column with anonymous slots (of what size?).
2243+
<p>Same as 'auto 1 1'
2244+
2245+
<dt>auto <var>W</var> <var>H</var>
2246+
<dd>
2247+
<p>The <em>automatic placement</em> algorithm, see below.
22312248

22322249
<dt><var>X</var> <var>Y</var>
22332250
<dd>
@@ -2260,7 +2277,7 @@ <h3>Stacking elements on top of a grid: 'grid-area'</h3>
22602277
the grid line at which the nearest preceding element was positioned,
22612278
in particular: the nearest preceding element in document order with
22622279
the same <span>grid ancestor</span> to which 'grid-area' applied. If
2263-
there is no such element, or if its 'grid-value' was ''none'', then
2280+
there is no such element, or if its 'grid-area' was ''none'', then
22642281
''same'' stands for '1'.
22652282

22662283
<p>Similarly, the keyword ''next'' stands for the next grid line after
@@ -2273,9 +2290,59 @@ <h3>Stacking elements on top of a grid: 'grid-area'</h3>
22732290
<var>Y</var> + <var>H</var> refer to non-existent grid lines, then the
22742291
grid is extended with as many extra rows and or columns as needed.
22752292

2276-
<p class=issue>With what size?
2293+
<p class=issue>With what size? Need to add 'grid-auto-columns' and
2294+
'grid-auto-rows' to set the width/height of automatically added rows
2295+
and columns.
2296+
</dl>
2297+
2298+
<p>The value of 'grid-auto' determines the <dfn>automatic
2299+
placement</dfn> algorithm and is used if 'grid-area' is ''auto
2300+
<var>W</var> <var>H</var>'' (including just ''auto''). The values are
2301+
as follows:
2302+
2303+
<dl>
2304+
<dt>none
2305+
<dd>
2306+
<p>The element is positioned as if its 'grid-area' were '1 1
2307+
<var>W</var> <var>H</var>'
2308+
2309+
<p class=issue>This is thus not very useful. Drop this value?
2310+
2311+
<dt>rows
2312+
<dd>
2313+
<p>The element is positioned as high as possible in the grid (and if
2314+
there are multiple solutions at the same height: as far to the left as
2315+
possible) such that is doesn't overlap with any earlier elements in
2316+
the document that have the same <em>grid ancestor</em> and 'grid-area'
2317+
other then ''none''. More precisely: the element is placed as for
2318+
'grid-area: <var>x</var> <var>y</var> <var>W</var> <var>H</var>, where
2319+
<var>x</var> and <var>y</var> are chosen as follows: <span
2320+
class=issue>Define. Tight packing (i.e., closest to top left corner)
2321+
or preserve element order (i.e., to the right or below of previous
2322+
element)?</span>
2323+
2324+
<p>The name 'rows' comes from the fact that this algorithms tends to
2325+
fill a row with subsequent elements and then adds new rows
2326+
below. E.g., if all children of a grid element have 'grid-area: auto'
2327+
and 'grid-auto: row', they will be placed one after the other on the
2328+
same row until the row is full, and then on the next row, etc.
2329+
2330+
<dt>columns
2331+
<dd>
2332+
<p>The element is positioned as far to the left as possible in the
2333+
grid (and if there are multiple solutions: as high as possible) such
2334+
that is doesn't overlap with any earlier elements in the document that
2335+
have the same <em>grid ancestor</em> and 'grid-area' other then
2336+
''none''. More precisely: the element is placed as for 'grid-area:
2337+
<var>x</var> <var>y</var> <var>W</var> <var>H</var>, where
2338+
<var>x</var> and <var>y</var> are chosen as follows: <span
2339+
class=issue>define</span>
22772340
</dl>
22782341

2342+
<p class=issue>The pair of keywords ''same/next'' and the pair
2343+
'grid-auto'/''auto'' do the same thing in different ways. We need only
2344+
one. Which is easier?
2345+
22792346
<p>If an elements has a 'grid-area' other than ''none'', then the
22802347
'float' property does not apply and the values of 'display' are
22812348
determined according to this table:
@@ -2361,10 +2428,20 @@ <h3>Stacking elements on top of a grid: 'grid-area'</h3>
23612428
<p>with style rules like this:
23622429

23632430
<pre>
2364-
TABLE {grid-columns: auto; grid-rows: auto}
2431+
TABLE {grid: "*"}
23652432
TD:first-child {grid-area: next 1}
23662433
TD {grid-area: same next}
23672434
</pre>
2435+
2436+
<div class=issue>
2437+
<p>Or with 'grid-auto':
2438+
2439+
<pre>
2440+
TABLE {grid: "*"}
2441+
TD {grid-area: auto; grid-auto: columns}
2442+
TD:first-child {grid-auto: rows}
2443+
</pre>
2444+
</div>
23682445
</div>
23692446

23702447
<p

0 commit comments

Comments
 (0)