Skip to content

Commit 30f90cc

Browse files
committed
[css-grid] Remove layering example that confuses people, and could alternatively be handled with flex layout anyway.
1 parent e39daf7 commit 30f90cc

1 file changed

Lines changed: 2 additions & 90 deletions

File tree

css-grid/Overview.bs

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,8 @@ Background and Motivation</h3>
327327
using a set of predictable sizing behaviors.
328328
Authors can then precisely position and size the building block elements of their application
329329
into the <a>grid areas</a> defined by the intersections of these columns and rows.
330-
331-
<h3 id="overview-examples">
332-
Sample Use Cases</h3>
333-
334-
<em>This section is not normative.</em>
330+
The following examples illustrate the adaptive capabilities of grid layout,
331+
and how it allows a cleaner separation of content and style.
335332

336333
<h4 id='adapting-to-available-space'>
337334
Adapting Layouts to Available Space</h4>
@@ -529,91 +526,6 @@ Source-Order Independence</h4>
529526
as a substitute for correct source ordering,
530527
as that can ruin the accessibility of the document.
531528

532-
<h4 id='grid-layering'>
533-
Grid Layering of Elements</h4>
534-
535-
<figure class="sidefigure">
536-
<img alt="Image: A control composed of layered HTML elements." src="images/control-layering-and-alignment.png" />
537-
538-
<figcaption>A control composed of layered HTML elements.</figcaption>
539-
</figure>
540-
541-
In the example shown in Figure 6,
542-
the author is creating a custom slider control.
543-
<ul>
544-
<li>
545-
The control has six parts.
546-
<li>
547-
The lower-limit and upper-limit labels align to the left and right edges of the control.
548-
<li>
549-
The track of the slider spans the area between the labels.
550-
<li>
551-
The lower-fill and upper-fill parts touch beneath the thumb.
552-
<li>
553-
The thumb is a fixed width and height that can be moved along the track
554-
by updating the two flex-sized columns.
555-
<li>
556-
The thumb,
557-
snaps to various positions along the track
558-
as the 'grid-template-columns' property of the <a>grid container</a> is updated.
559-
</ul>
560-
561-
562-
563-
<div class="example">
564-
<pre class="lang-css">
565-
#grid {
566-
display: grid;
567-
568-
/* The grid-template-columns and rows properties also support
569-
* naming grid lines which can then be used to position grid
570-
* items. The line names are assigned on either side of a column
571-
* or row sizing function where the line would logically exist. */
572-
grid-template-columns:
573-
[start] auto
574-
[track-start] 0.5fr
575-
[thumb-start] auto
576-
[fill-split] auto
577-
[thumb-end] 0.5fr
578-
[track-end] auto
579-
[end];
580-
}
581-
582-
/* The grid-placement properties accept named lines. Below the
583-
* lines are referred to by name. Beyond any
584-
* semantic advantage, the names also allow the author to avoid
585-
* renumbering the grid-column-start and grid-row-start properties of the
586-
* grid items. This is similar to the concept demonstrated in the
587-
* prior example with the grid-template-areas property during orientation
588-
* changes, but grid lines can also work with layered grid items
589-
* that have overlapping areas of different shapes like the thumb
590-
* and track parts in this example. */
591-
#low-label { grid-column-start: start; }
592-
#track { grid-column: track-start / track-end; justify-self: center; }
593-
#high-label { grid-column-end: end; }
594-
595-
/* Fill parts are drawn above the track so set z-index to 5. */
596-
#low-fill { grid-column: track-start / fill-split;
597-
justify-self: end;
598-
z-index: 5; }
599-
#high-fill { grid-column: fill-split / track-end;
600-
justify-self: start;
601-
z-index: 5; }
602-
603-
/* Thumb is the topmost part; assign it the highest z-index value. */
604-
#thumb { grid-column: thumb-start / thumb-end; z-index: 10 }
605-
</pre>
606-
<pre class="lang-markup">
607-
&lt;div id="grid">
608-
&lt;div id="low-label">0&lt;/div>
609-
&lt;div id="high-label">50&lt;/div>
610-
&lt;div id="track">&lt;/div>
611-
&lt;div id="low-fill">&lt;/div>
612-
&lt;div id="high-fill">&lt;/div>
613-
&lt;div id="thumb">&lt;/div>
614-
&lt;/div>
615-
</pre>
616-
</div>
617529

618530
<!--
619531
██████ ███████ ██ ██ ██████ ████████ ████████ ████████ ██████

0 commit comments

Comments
 (0)