blob: c2c722485f1f9b0c0667a317649e5817ecdefb34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Support for named grid lines when 'grid-template-columns' and 'grid-template-rows' have multiple values inside of a repeat.</title>
<link rel="author" title="Mozilla" href="https://mozilla.org">
<link rel="help" href="https://www.w3.org/TR/css-grid-1/#named-lines" title="5.1.1. Named Grid Lines: the '(<custom-ident\>*)' syntax">
<link rel="help" href="https://www.w3.org/TR/css-grid-1/#valdef-repeat-auto-fill" title="7.2.2.2. Repeat-to-fill: 'auto-fill' and 'auto-fit' repetitions">
<link rel="match" href="grid-support-named-grid-lines-003-ref.html">
<style>
.holder {
width: 300px;
height: 20px;
border-bottom: 2px solid #cfbfcf;
}
.grid-container {
display: grid;
/*
Defines the grid areas 'repeat', which covers the repeat only, and
'around-repeat' which covers the repeat and one track on either end.
Provides the line name 'all' in every track, the line names 'v' and 'u'
which alternates in every grid line.
*/
grid-template-columns: [v] 10px [around-repeat-start a t-start w-start u all] 20px [repeat-start b] repeat(auto-fit, [all x v] 30px [all w-end y u] 40px [all t-end z]) [repeat-end c v] 50px [around-repeat-end all d u] 60px [e v];
grid-template-rows:
[w-start t-start around-repeat-start repeat-start]
repeat(auto-fit, 8px)
[w-end t-end around-repeat-end repeat-end ]
8px;
grid-row-gap: 2px;
}
.grid-container > :nth-child(3n) { background: sienna; }
.grid-container > :nth-child(3n+1) { background: gold; }
.grid-container > :nth-child(3n+2) { background: orange; }
/* Alternate colors for some grid containers, where sometimes multiple grid
items would appear as one item or the actual ordering would be ambiguous
otherwise. */
.alt-color > :nth-child(2n) { background: sienna; }
.alt-color > :nth-child(2n+1) { background: orange; }
</style>
<p>The test passes if it has the same visual effect as reference.</p>
<!-- Use line names that are inside a repeat. -->
<div class="holder">
<div class="grid-container">
<div style="grid-column-start:x"></div>
<div style="grid-column-start:z"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div></div>
<div style="grid-column-start:x"></div>
<div style="grid-column-start:z"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div style="grid-column-start:x 1"></div>
<div style="grid-column-start:z 2"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div></div>
<div style="grid-column-start:x 1"></div>
<div style="grid-column-start:z 2"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<!-- Using a span that goes from outside a repeat to inside the repeat. -->
<div class="holder">
<div class="grid-container">
<div style="grid-column:u / y"></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div style="grid-column:u / z"></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<!-- Using an area which has one end inside the repeat. -->
<div class="holder">
<div class="grid-container">
<div style="grid-area: t;"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container alt-color">
<div style="grid-area: t;"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div></div>
<div style="grid-area: t;"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div style="grid-area: w;"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container alt-color">
<div style="grid-area: w;"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div></div>
<div style="grid-area: w;"></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<!-- Using an area which spans the entire repeat. -->
<div class="holder">
<div class="grid-container">
<div></div>
<div></div>
<div style="grid-area: repeat;"></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div></div>
<div style="grid-area: repeat;"></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container alt-color">
<div></div>
<div style="grid-area: repeat;"></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div style="grid-area: repeat;"></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div></div>
<div style="grid-area: around-repeat;"></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container alt-color">
<div></div>
<div style="grid-area: around-repeat;"></div>
<div></div>
</div>
</div>
<div class="holder">
<div class="grid-container">
<div style="grid-area: around-repeat;"></div>
<div></div>
</div>
</div>
|