@@ -5,7 +5,7 @@ export default {
5
5
title : 'Base/Grid' ,
6
6
parameters : {
7
7
layout : 'fullscreen' ,
8
- docs : '<div class="grid-story-docs story-grid-outlines row row--no-grow"><strong>Outline colors: </strong><span class="col grid-story-docs-color-container-contained">Contained container</span><span class="col grid-story-docs-color-container-fluid">Fluid container</span><span class="col grid-story-docs-color-row">Row</span><span class="col grid-story-docs-color-template-column">Template column</span><span class="col grid-story-docs-color-auto-column">Auto column</span><span class="col grid-story-docs-color-placeholder">Placeholder</span></div>' ,
8
+ docs : '<div class="grid-story-docs story-grid-outlines row row--no-grow"><strong>Outline colors: </strong><br/>< span class="col grid-story-docs-color-container-contained">Contained container</span><span class="col grid-story-docs-color-container-fluid">Fluid container</span><span class="col grid-story-docs-color-row">Row</span><span class="col grid-story-docs-color-template-column">Template column</span><span class="col grid-story-docs-color-auto-column">Auto column</span><span class="col grid-story-docs-color-placeholder">Placeholder</span></div>' ,
9
9
docsClass : 'story-docs--conditional' ,
10
10
} ,
11
11
} ;
@@ -42,7 +42,7 @@ export const Grid = () => {
42
42
43
43
html += `<div class="story-container__title">Columns</div>` ;
44
44
45
- html += `<div class="story-container__subtitle">Template column ${ code ( '.row > .col-[breakpoint]-[column]' ) } </div>` ;
45
+ html += `<div class="story-container__subtitle">Template column in container ${ code ( '.container > .row > .col-[breakpoint]-[column]' ) } </div>` ;
46
46
cols = [ 1 , 2 , 3 , 4 , 6 , 12 ] ;
47
47
for ( let j = 0 ; j < cols . length ; j ++ ) {
48
48
html += CivicThemeGrid ( {
@@ -52,7 +52,7 @@ export const Grid = () => {
52
52
} ) ;
53
53
}
54
54
55
- html += `<div class="story-container__subtitle">Template column ${ code ( '.row > .col-[breakpoint]-[column]' ) } </div>` ;
55
+ html += `<div class="story-container__subtitle">Template column in fluid container ${ code ( '.container-fluid > .row > .col-[breakpoint]-[column]' ) } </div>` ;
56
56
cols = [ 1 ] ;
57
57
for ( let j = 0 ; j < cols . length ; j ++ ) {
58
58
html += CivicThemeGrid ( {
@@ -63,7 +63,7 @@ export const Grid = () => {
63
63
} ) ;
64
64
}
65
65
66
- html += `<div class="story-container__subtitle">Auto column ${ code ( '.row > .col' ) } </div>` ;
66
+ html += `<div class="story-container__subtitle">Auto column in container ${ code ( '.container .row > .col' ) } </div>` ;
67
67
cols = [ 1 , 2 , 3 , 4 , 6 , 12 ] ;
68
68
for ( let j = 0 ; j < cols . length ; j ++ ) {
69
69
html += CivicThemeGrid ( {
@@ -74,7 +74,7 @@ export const Grid = () => {
74
74
75
75
html += `<div class="story-container__title">Offsets and order</div>` ;
76
76
77
- html += `<div class="story-container__subtitle">Template column ${ code ( '.row > .col-[breakpoint]-offset-[column]' ) } </div>` ;
77
+ html += `<div class="story-container__subtitle">Template column in container ${ code ( '.container > .row > .col-[breakpoint]-offset-[column]' ) } </div>` ;
78
78
cols = [ 1 , 2 , 3 , 4 , 6 , 12 ] ;
79
79
let offsets = [ 1 , 2 , 3 , 4 , 6 , 8 ] ;
80
80
for ( let j = 0 ; j < cols . length ; j ++ ) {
@@ -86,7 +86,7 @@ export const Grid = () => {
86
86
} ) ;
87
87
}
88
88
89
- html += `<div class="story-container__subtitle">Auto column ${ code ( '.row > .col.col-[breakpoint]-offset-[column]' ) } </div>` ;
89
+ html += `<div class="story-container__subtitle">Auto column in container ${ code ( '.container > .row > .col.col-[breakpoint]-offset-[column]' ) } </div>` ;
90
90
cols = [ 1 , 2 , 3 , 4 , 6 , 12 ] ;
91
91
offsets = [ 1 , 2 , 3 , 4 , 6 , 8 ] ;
92
92
for ( let j = 0 ; j < cols . length ; j ++ ) {
@@ -123,9 +123,9 @@ export const Grid = () => {
123
123
column_class : 'col' ,
124
124
} ) ;
125
125
126
- html += `<div class="story-container__title">Nested</div>` ;
126
+ html += `<div class="story-container__title">Nested Rows (container-less) </div>` ;
127
127
128
- html += `<div class="story-container__subtitle">Template column ${ code ( '.row > .col-[breakpoint]-[column]' ) } </div>` ;
128
+ html += `<div class="story-container__subtitle">Template column wraps template column ${ code ( '.row > .col-[breakpoint]-[column] > .row > .col-[breakpoint]-[column]' ) } </div>` ;
129
129
cols = [ 'A' , 'B' , 'C' , 'D' ] ;
130
130
html += CivicThemeGrid ( {
131
131
items : [
@@ -136,15 +136,18 @@ export const Grid = () => {
136
136
placeholder ( 'Nested' ) ,
137
137
] ,
138
138
use_container : false ,
139
+ template_column_count : 3 ,
139
140
column_attributes : 'data-story-total-columns="3"' ,
140
141
} ) ,
141
142
placeholder ( 'Parent' ) ,
142
143
] ,
144
+ use_container : false ,
143
145
template_column_count : 2 ,
144
146
column_attributes : 'data-story-total-columns="2"' ,
147
+ modifier_class : 'row--no-gutters' ,
145
148
} ) ;
146
149
147
- html += `<div class="story-container__subtitle">Auto column ${ code ( '.row > .col' ) } </div>` ;
150
+ html += `<div class="story-container__subtitle">Template column wraps auto column ${ code ( '.row > .col-[breakpoint]-[column] > .row > .col' ) } </div>` ;
148
151
cols = [ 'A' , 'B' , 'C' , 'D' ] ;
149
152
html += CivicThemeGrid ( {
150
153
items : [
@@ -159,33 +162,206 @@ export const Grid = () => {
159
162
} ) ,
160
163
placeholder ( 'Parent' ) ,
161
164
] ,
165
+ use_container : false ,
166
+ template_column_count : 2 ,
162
167
column_attributes : 'data-story-total-columns="2"' ,
168
+ modifier_class : 'row--no-gutters' ,
163
169
} ) ;
164
170
165
- html += `<div class="story-container__title">Row utilities</div>` ;
171
+ html += `<div class="story-container__subtitle">Auto column wraps auto-column ${ code ( '.row > .col > .row > .col' ) } </div>` ;
172
+ cols = [ 'A' , 'B' , 'C' , 'D' ] ;
173
+ html += CivicThemeGrid ( {
174
+ items : [
175
+ CivicThemeGrid ( {
176
+ items : [
177
+ placeholder ( 'Nested' ) ,
178
+ placeholder ( 'Nested' ) ,
179
+ placeholder ( 'Nested' ) ,
180
+ ] ,
181
+ use_container : false ,
182
+ } ) ,
183
+ placeholder ( 'Parent' ) ,
184
+ ] ,
185
+ use_container : false ,
186
+ modifier_class : 'row--no-gutters' ,
187
+ } ) ;
166
188
167
- html += `<div class="story-container__subtitle">Reversed columns ${ code ( '.row.row--reverse' ) } </div>` ;
189
+ html += `<div class="story-container__subtitle">Auto column wraps template column ${ code ( '.row > .col > .row > .col-[breakpoint]-[column]' ) } </div>` ;
190
+ cols = [ 'A' , 'B' , 'C' , 'D' ] ;
191
+ html += CivicThemeGrid ( {
192
+ items : [
193
+ CivicThemeGrid ( {
194
+ items : [
195
+ placeholder ( 'Nested' ) ,
196
+ placeholder ( 'Nested' ) ,
197
+ placeholder ( 'Nested' ) ,
198
+ ] ,
199
+ use_container : false ,
200
+ template_column_count : 3 ,
201
+ column_attributes : 'data-story-total-columns="3"' ,
202
+ } ) ,
203
+ placeholder ( 'Parent' ) ,
204
+ ] ,
205
+ use_container : false ,
206
+ modifier_class : 'row--no-gutters' ,
207
+ } ) ;
208
+
209
+ html += `<div class="story-container__title">Nested Containers</div>` ;
210
+
211
+ html += `<div class="story-container__subtitle">Container with template columns wraps container with template columns ${ code ( '.container .row > .col-[breakpoint]-[column] .container > .row > .col-[breakpoint]-[column]' ) } </div>` ;
212
+ cols = [ 'A' , 'B' , 'C' , 'D' ] ;
213
+ html += CivicThemeGrid ( {
214
+ items : [
215
+ CivicThemeGrid ( {
216
+ items : [
217
+ placeholder ( 'Nested' ) ,
218
+ placeholder ( 'Nested' ) ,
219
+ placeholder ( 'Nested' ) ,
220
+ ] ,
221
+ use_container : true ,
222
+ is_fluid : false ,
223
+ column_attributes : 'data-story-total-columns="3"' ,
224
+ } ) ,
225
+ placeholder ( 'Parent' ) ,
226
+ ] ,
227
+ use_container : true ,
228
+ is_fluid : false ,
229
+ template_column_count : 2 ,
230
+ column_attributes : 'data-story-total-columns="2"' ,
231
+ } ) ;
232
+
233
+ html += `<div class="story-container__subtitle">Fluid container with template columns wraps container with template columns ${ code ( '.container-fluid .row > .col-[breakpoint]-[column] .container > .row > .col-[breakpoint]-[column]' ) } </div>` ;
168
234
cols = [ 'A' , 'B' , 'C' , 'D' ] ;
235
+ html += CivicThemeGrid ( {
236
+ items : [
237
+ CivicThemeGrid ( {
238
+ items : [
239
+ placeholder ( 'Nested' ) ,
240
+ placeholder ( 'Nested' ) ,
241
+ placeholder ( 'Nested' ) ,
242
+ ] ,
243
+ use_container : true ,
244
+ is_fluid : false ,
245
+ column_attributes : 'data-story-total-columns="3"' ,
246
+ } ) ,
247
+ placeholder ( 'Parent' ) ,
248
+ ] ,
249
+ use_container : true ,
250
+ is_fluid : true ,
251
+ template_column_count : 2 ,
252
+ column_attributes : 'data-story-total-columns="2"' ,
253
+ } ) ;
254
+
255
+ html += `<div class="story-container__subtitle">Fluid container with template columns wraps container with template columns (single column) ${ code ( '.container-fluid .row > .col-[breakpoint]-[column] .container > .row > .col-[breakpoint]-[column]' ) } </div>` ;
256
+ cols = [ 'A' , 'B' , 'C' , 'D' ] ;
257
+ html += CivicThemeGrid ( {
258
+ items : [
259
+ CivicThemeGrid ( {
260
+ items : [
261
+ placeholder ( 'Nested' ) ,
262
+ placeholder ( 'Nested' ) ,
263
+ placeholder ( 'Nested' ) ,
264
+ ] ,
265
+ use_container : true ,
266
+ is_fluid : false ,
267
+ column_attributes : 'data-story-total-columns="3"' ,
268
+ } ) ,
269
+ ] ,
270
+ use_container : true ,
271
+ is_fluid : true ,
272
+ template_column_count : 1 ,
273
+ } ) ;
274
+
275
+ html += `<div class="story-container__subtitle">Container with template columns wraps fluid container with template columns ${ code ( '.container .row > .col-[breakpoint]-[column] .container-fluid > .row > .col-[breakpoint]-[column]' ) } </div>` ;
276
+ cols = [ 'A' , 'B' , 'C' , 'D' ] ;
277
+ html += CivicThemeGrid ( {
278
+ items : [
279
+ CivicThemeGrid ( {
280
+ items : [
281
+ placeholder ( 'Nested' ) ,
282
+ placeholder ( 'Nested' ) ,
283
+ placeholder ( 'Nested' ) ,
284
+ ] ,
285
+ use_container : true ,
286
+ is_fluid : true ,
287
+ column_attributes : 'data-story-total-columns="3"' ,
288
+ } ) ,
289
+ placeholder ( 'Parent' ) ,
290
+ ] ,
291
+ use_container : true ,
292
+ is_fluid : false ,
293
+ template_column_count : 2 ,
294
+ column_attributes : 'data-story-total-columns="2"' ,
295
+ } ) ;
296
+
297
+ html += `<div class="story-container__subtitle">Fluid container with template columns wraps fluid container with template columns ${ code ( '.container-fluid .row > .col-[breakpoint]-[column] .container-fluid > .row > .col-[breakpoint]-[column]' ) } </div>` ;
298
+ cols = [ 'A' , 'B' , 'C' , 'D' ] ;
299
+ html += CivicThemeGrid ( {
300
+ items : [
301
+ CivicThemeGrid ( {
302
+ items : [
303
+ placeholder ( 'Nested' ) ,
304
+ placeholder ( 'Nested' ) ,
305
+ placeholder ( 'Nested' ) ,
306
+ ] ,
307
+ use_container : true ,
308
+ is_fluid : true ,
309
+ column_attributes : 'data-story-total-columns="3"' ,
310
+ } ) ,
311
+ placeholder ( 'Parent' ) ,
312
+ ] ,
313
+ use_container : true ,
314
+ is_fluid : true ,
315
+ template_column_count : 2 ,
316
+ column_attributes : 'data-story-total-columns="2"' ,
317
+ } ) ;
318
+
319
+ html += `<div class="story-container__title">Row utilities</div>` ;
320
+
321
+ html += `<div class="story-container__subtitle">No gutters ${ code ( '.row.row--no-gutters' ) } </div>` ;
322
+ cols = [ 'A' , 'B' , 'C' , 'D' , 'E' ] ;
169
323
html += CivicThemeGrid ( {
170
324
items : generateItems ( cols . length , ( i ) => placeholder ( cols [ i - 1 ] ) ) ,
171
325
column_attributes : `data-story-total-columns="${ cols . length } "` ,
172
- template_column_count : cols . length ,
173
- row_class : 'row row--reverse ' ,
326
+ use_container : false ,
327
+ row_class : 'row row--no-gutters ' ,
174
328
} ) ;
175
329
176
- html += `<div class="story-container__subtitle">Equal column heights by default</div>` ;
177
- cols = [ `<strong>Content should not fill - height is not 100%.</strong> ${ randomSentence ( 5 , 'A' ) } ` , randomSentence ( 30 , 'B' ) , randomSentence ( 5 , 'C' ) , randomSentence ( 5 , 'D' ) ] ;
330
+ html += `<div class="story-container__subtitle">No gutters within container ${ code ( '.container > .row.row--no-gutters' ) } </div>` ;
331
+ cols = [ 'A' , 'B' , 'C' , 'D' , 'E' ] ;
332
+ html += CivicThemeGrid ( {
333
+ items : generateItems ( cols . length , ( i ) => placeholder ( cols [ i - 1 ] ) ) ,
334
+ column_attributes : `data-story-total-columns="${ cols . length } "` ,
335
+ use_container : true ,
336
+ is_fluid : false ,
337
+ row_class : 'row row--no-gutters' ,
338
+ } ) ;
339
+
340
+ html += `<div class="story-container__subtitle">No gutters within fluid container ${ code ( '.container-fluid > .row.row--no-gutters' ) } </div>` ;
341
+ cols = [ 'A' , 'B' , 'C' , 'D' , 'E' ] ;
342
+ html += CivicThemeGrid ( {
343
+ items : generateItems ( cols . length , ( i ) => placeholder ( cols [ i - 1 ] ) ) ,
344
+ column_attributes : `data-story-total-columns="${ cols . length } "` ,
345
+ use_container : true ,
346
+ is_fluid : true ,
347
+ row_class : 'row row--no-gutters' ,
348
+ } ) ;
349
+
350
+ html += `<div class="story-container__subtitle">Reversed columns ${ code ( '.row.row--reverse' ) } </div>` ;
351
+ cols = [ 'A' , 'B' , 'C' , 'D' ] ;
178
352
html += CivicThemeGrid ( {
179
353
items : generateItems ( cols . length , ( i ) => placeholder ( cols [ i - 1 ] ) ) ,
180
354
column_attributes : `data-story-total-columns="${ cols . length } "` ,
181
355
template_column_count : cols . length ,
356
+ row_class : 'row row--reverse' ,
182
357
} ) ;
183
358
184
- html += `<div class="story-container__subtitle">Equal column heights by default - Auto column </div>` ;
359
+ html += `<div class="story-container__subtitle">Equal column heights by default</div>` ;
185
360
cols = [ `<strong>Content should not fill - height is not 100%.</strong> ${ randomSentence ( 5 , 'A' ) } ` , randomSentence ( 30 , 'B' ) , randomSentence ( 5 , 'C' ) , randomSentence ( 5 , 'D' ) ] ;
186
361
html += CivicThemeGrid ( {
187
362
items : generateItems ( cols . length , ( i ) => placeholder ( cols [ i - 1 ] ) ) ,
188
363
column_attributes : `data-story-total-columns="${ cols . length } "` ,
364
+ template_column_count : cols . length ,
189
365
} ) ;
190
366
191
367
html += `<div class="story-container__subtitle">Equal column heights propagated to content ${ code ( '.row.row--equal-heights-content > .col-[breakpoint]-[column]' ) } </div>` ;
0 commit comments