Skip to content

Commit 4632fd7

Browse files
committed
[css-grid] s/areas/components/ to avoid confusion with grid areas; reformat example code per kaelig's suggestion
1 parent 5174f4e commit 4632fd7

1 file changed

Lines changed: 22 additions & 12 deletions

File tree

css-grid/Overview.bs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Adapting Layouts to Available Space</h3>
135135
</figure>
136136

137137
Grid layout can be used to intelligently reflow elements within a webpage.
138-
Figure 2 represents a game with five major areas in the layout:
138+
Figure 2 represents a game with five major components in the layout:
139139
the game title, stats area, game board, score area, and control area.
140140
The author's intent is to divide the space for the game such that:
141141

@@ -169,18 +169,28 @@ Adapting Layouts to Available Space</h3>
169169
<div class="example">
170170
<pre class="lang-css">
171171
#grid {
172+
/**
173+
* Two columns:
174+
* 1. the first sized to content,
175+
* 2. the second receives the remaining space
176+
* (but is never smaller than the minimum size of the board
177+
* or the game controls, which occupy this column [3])
178+
*
179+
* Three rows:
180+
* 3. the first sized to content,
181+
* 4. the middle row receives the remaining space
182+
* (but is never smaller than the minimum height
183+
* of the board or stats areas)
184+
* 5. the last sized to content.
185+
*/
172186
display: grid;
173-
174-
/* Two columns: the first sized to content, the second receives
175-
* the remaining space, but is never smaller than the minimum
176-
* size of the board or the game controls, which occupy this
177-
* column. */
178-
grid-template-columns: auto 1fr;
179-
180-
/* Three rows: the first and last sized to content, the middle
181-
* row receives the remaining space, but is never smaller than
182-
* the minimum height of the board or stats areas. */
183-
grid-template-rows: auto 1fr auto;
187+
grid-template-columns:
188+
/* 1 */ auto
189+
/* 2 */ 1fr;
190+
grid-template-rows:
191+
/* 3 */ auto
192+
/* 4 */ 1fr
193+
/* 5 */ auto;
184194
}
185195

186196
/* Each part of the game is positioned between grid lines by

0 commit comments

Comments
 (0)