vanilla-framework 4.51.0 → 4.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scss/_layouts_full-width.scss +1 -2
- package/scss/_patterns_content-card.scss +204 -13
- package/scss/_patterns_lists.scss +3 -3
- package/scss/_patterns_suru.scss +3 -3
- package/templates/_macros/vf_card.jinja +24 -14
- package/templates/_macros/vf_equal-heights.jinja +9 -10
- package/templates/_macros/vf_tiered-list.jinja +15 -19
- package/templates/static/js/example.js +1 -1
package/package.json
CHANGED
|
@@ -19,11 +19,10 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.l-full-width__sidebar {
|
|
22
|
-
background: $colors--theme--background-alt;
|
|
23
|
-
|
|
24
22
|
// height of top navigation, as padding applied to .p-navigation__link + line-heigh of the anchor text inside
|
|
25
23
|
$navigation-top-height: $spv--large * 2 + map-get($settings-text-default, line-height);
|
|
26
24
|
|
|
25
|
+
background: $colors--theme--background-alt;
|
|
27
26
|
height: calc(100% - $navigation-top-height); // height of document reduced by height of top nav
|
|
28
27
|
min-height: calc(100dvh - $navigation-top-height);
|
|
29
28
|
position: absolute;
|
|
@@ -10,10 +10,14 @@
|
|
|
10
10
|
Modifier for a 4-column width horizontal layout. Applied ONLY to the parent .p-content-card.
|
|
11
11
|
"&.p-content-card--cols-6":
|
|
12
12
|
Modifier for a 6-column width horizontal layout. Applied ONLY to the parent .p-content-card.
|
|
13
|
+
"&.p-content-card--cols-8":
|
|
14
|
+
Modifier for an 8-column (full-width) layout with 50/50 content and image split on desktop. Applied ONLY to the parent .p-content-card. Image is required.
|
|
15
|
+
"&.p-content-card--image-top":
|
|
16
|
+
Modifier that forces the image to appear above the content on all breakpoints and all column variants, overriding the default horizontal and grid layouts.
|
|
13
17
|
"&.has-image":
|
|
14
18
|
State class applied to the parent when the card includes an image.
|
|
15
19
|
"&.has-desc":
|
|
16
|
-
State class applied to the parent when the card includes a description
|
|
20
|
+
State class applied to the parent when the card includes a description. For col-2/4/6 the description slides up on hover; for col-8 it is always visible below the heading.
|
|
17
21
|
Links:
|
|
18
22
|
.p-content-card__overlay-link:
|
|
19
23
|
Invisible absolute link spanning the entire card to make it clickable.
|
|
@@ -78,9 +82,10 @@ $card-author-padding-bottom: $sp-small;
|
|
|
78
82
|
|
|
79
83
|
$card-fallback-spacing-large: $sp-x-large;
|
|
80
84
|
$card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
85
|
+
$card-height-8col: 22rem;
|
|
81
86
|
|
|
82
87
|
@mixin mq-min($breakpoint) {
|
|
83
|
-
@media screen and (width
|
|
88
|
+
@media screen and (width >=$breakpoint) {
|
|
84
89
|
@content;
|
|
85
90
|
}
|
|
86
91
|
}
|
|
@@ -92,7 +97,7 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
@mixin mq-between($min, $max) {
|
|
95
|
-
@media screen and ($min <=
|
|
100
|
+
@media screen and ($min <=width < $max) {
|
|
96
101
|
@content;
|
|
97
102
|
}
|
|
98
103
|
}
|
|
@@ -111,18 +116,24 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
111
116
|
|
|
112
117
|
/* 2-Column Spanning */
|
|
113
118
|
&--2 {
|
|
114
|
-
grid-column: 1 / -1;
|
|
119
|
+
grid-column: 1 / -1;
|
|
120
|
+
|
|
121
|
+
/* Mobile */
|
|
115
122
|
@include mq-between($breakpoint-small, $breakpoint-large) {
|
|
116
|
-
grid-column: span 2;
|
|
123
|
+
grid-column: span 2;
|
|
124
|
+
/* Medium */
|
|
117
125
|
}
|
|
126
|
+
|
|
118
127
|
@include mq-min($breakpoint-large) {
|
|
119
|
-
grid-column: span 2;
|
|
128
|
+
grid-column: span 2;
|
|
129
|
+
/* Desktop */
|
|
120
130
|
}
|
|
121
131
|
}
|
|
122
132
|
|
|
123
133
|
/* 4-Column Spanning */
|
|
124
134
|
&--4 {
|
|
125
135
|
grid-column: 1 / -1;
|
|
136
|
+
|
|
126
137
|
@include mq-min($breakpoint-large) {
|
|
127
138
|
grid-column: span 4;
|
|
128
139
|
}
|
|
@@ -131,10 +142,16 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
131
142
|
/* 6-Column Spanning */
|
|
132
143
|
&--6 {
|
|
133
144
|
grid-column: 1 / -1;
|
|
145
|
+
|
|
134
146
|
@include mq-min($breakpoint-large) {
|
|
135
147
|
grid-column: span 6;
|
|
136
148
|
}
|
|
137
149
|
}
|
|
150
|
+
|
|
151
|
+
/* 8-Column Spanning (full width) */
|
|
152
|
+
&--8 {
|
|
153
|
+
grid-column: 1 / -1;
|
|
154
|
+
}
|
|
138
155
|
}
|
|
139
156
|
|
|
140
157
|
/* =========================================
|
|
@@ -168,7 +185,8 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
168
185
|
&:not(:has(.p-content-card__footer-outer)) {
|
|
169
186
|
height: auto;
|
|
170
187
|
min-height: 0;
|
|
171
|
-
padding-bottom: var(--spacing-vertical-large, $sp-medium);
|
|
188
|
+
padding-bottom: var(--spacing-vertical-large, $sp-medium);
|
|
189
|
+
/* Keeps spacing balanced */
|
|
172
190
|
}
|
|
173
191
|
}
|
|
174
192
|
|
|
@@ -221,6 +239,16 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
221
239
|
}
|
|
222
240
|
}
|
|
223
241
|
|
|
242
|
+
/* 8-Column: Desktop horizontal grid layout */
|
|
243
|
+
@include mq-min($breakpoint-large) {
|
|
244
|
+
&.p-content-card--cols-8.has-image {
|
|
245
|
+
display: grid;
|
|
246
|
+
grid-template-columns: 1fr 1fr;
|
|
247
|
+
min-height: $card-height-8col;
|
|
248
|
+
padding: 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
224
252
|
&__overlay-link {
|
|
225
253
|
inset: 0;
|
|
226
254
|
position: absolute;
|
|
@@ -242,6 +270,18 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
242
270
|
line-clamp: 2;
|
|
243
271
|
}
|
|
244
272
|
|
|
273
|
+
.p-content-card--cols-8 & {
|
|
274
|
+
-webkit-line-clamp: 3;
|
|
275
|
+
line-clamp: 3;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@include mq-between($breakpoint-small, $breakpoint-large) {
|
|
279
|
+
.p-content-card--cols-8 & {
|
|
280
|
+
-webkit-line-clamp: 2;
|
|
281
|
+
line-clamp: 2;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
245
285
|
&:hover,
|
|
246
286
|
&:focus,
|
|
247
287
|
&:active,
|
|
@@ -268,7 +308,6 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
268
308
|
display: -webkit-box;
|
|
269
309
|
-webkit-line-clamp: 3;
|
|
270
310
|
line-clamp: 3;
|
|
271
|
-
line-height: 1.5;
|
|
272
311
|
margin-top: 0 !important;
|
|
273
312
|
max-height: 4.5em;
|
|
274
313
|
max-width: none;
|
|
@@ -283,11 +322,25 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
283
322
|
max-height: 3em;
|
|
284
323
|
}
|
|
285
324
|
|
|
325
|
+
.p-content-card--cols-8 & {
|
|
326
|
+
-webkit-line-clamp: 3;
|
|
327
|
+
line-clamp: 3;
|
|
328
|
+
max-height: 4.5em;
|
|
329
|
+
}
|
|
330
|
+
|
|
286
331
|
@include mq-min($breakpoint-large) {
|
|
287
332
|
.p-content-card--cols-6 & {
|
|
288
333
|
margin-top: $card-nudge-negative !important;
|
|
289
334
|
}
|
|
290
335
|
}
|
|
336
|
+
|
|
337
|
+
@include mq-between($breakpoint-small, $breakpoint-large) {
|
|
338
|
+
.p-content-card--cols-8 & {
|
|
339
|
+
-webkit-line-clamp: 2;
|
|
340
|
+
line-clamp: 2;
|
|
341
|
+
max-height: 3em;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
291
344
|
}
|
|
292
345
|
|
|
293
346
|
&__content {
|
|
@@ -298,6 +351,12 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
298
351
|
justify-content: space-between;
|
|
299
352
|
min-width: 0;
|
|
300
353
|
width: 100%;
|
|
354
|
+
|
|
355
|
+
@include mq-min($breakpoint-large) {
|
|
356
|
+
.p-content-card--cols-8 & {
|
|
357
|
+
grid-column: 1;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
301
360
|
}
|
|
302
361
|
|
|
303
362
|
&__body {
|
|
@@ -315,6 +374,20 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
315
374
|
padding: 0;
|
|
316
375
|
}
|
|
317
376
|
}
|
|
377
|
+
|
|
378
|
+
.p-content-card--cols-8 & {
|
|
379
|
+
display: flex;
|
|
380
|
+
flex-direction: column;
|
|
381
|
+
min-height: 0;
|
|
382
|
+
padding: 0 $sp-medium;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
@include mq-min($breakpoint-large) {
|
|
386
|
+
.p-content-card--cols-8 & {
|
|
387
|
+
align-self: stretch;
|
|
388
|
+
padding: $sp-medium $sp-medium 0 $sp-medium;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
318
391
|
}
|
|
319
392
|
|
|
320
393
|
&__primary-content,
|
|
@@ -335,6 +408,13 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
335
408
|
&__hover-content {
|
|
336
409
|
opacity: 0;
|
|
337
410
|
transform: translateY(150px);
|
|
411
|
+
|
|
412
|
+
.p-content-card--cols-8 & {
|
|
413
|
+
flex: 1;
|
|
414
|
+
min-height: 0;
|
|
415
|
+
opacity: 1;
|
|
416
|
+
transform: translateY(0);
|
|
417
|
+
}
|
|
338
418
|
}
|
|
339
419
|
|
|
340
420
|
&__description {
|
|
@@ -350,6 +430,19 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
350
430
|
line-clamp: 2;
|
|
351
431
|
}
|
|
352
432
|
|
|
433
|
+
.p-content-card--cols-8 & {
|
|
434
|
+
-webkit-line-clamp: 3;
|
|
435
|
+
line-clamp: 3;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
@include mq-max($breakpoint-large) {
|
|
439
|
+
.p-content-card--cols-8 & {
|
|
440
|
+
-webkit-line-clamp: 2;
|
|
441
|
+
line-clamp: 2;
|
|
442
|
+
margin-bottom: 1rem;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
353
446
|
@include mq-min($breakpoint-large) {
|
|
354
447
|
.p-content-card--cols-6 & {
|
|
355
448
|
margin-top: $card-nudge-negative !important;
|
|
@@ -359,9 +452,13 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
359
452
|
|
|
360
453
|
&__footer-container {
|
|
361
454
|
/* Structural grouping element.
|
|
362
|
-
Because the parent (.p-content-card__content) uses flexbox space-between,
|
|
455
|
+
Because the parent (.p-content-card__content) uses flexbox space-between,
|
|
363
456
|
this wrapper prevents the <hr> from floating awkwardly in the middle of the card.
|
|
364
457
|
*/
|
|
458
|
+
|
|
459
|
+
.p-content-card--cols-8 & {
|
|
460
|
+
width: 100%;
|
|
461
|
+
}
|
|
365
462
|
}
|
|
366
463
|
|
|
367
464
|
&__footer-outer {
|
|
@@ -444,6 +541,11 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
444
541
|
.p-content-card--cols-6 & {
|
|
445
542
|
height: $card-image-height-horizontal-large;
|
|
446
543
|
}
|
|
544
|
+
|
|
545
|
+
.p-content-card--cols-8 & {
|
|
546
|
+
aspect-ratio: auto;
|
|
547
|
+
height: 100%;
|
|
548
|
+
}
|
|
447
549
|
}
|
|
448
550
|
}
|
|
449
551
|
|
|
@@ -457,6 +559,17 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
457
559
|
|
|
458
560
|
width: 100%;
|
|
459
561
|
|
|
562
|
+
@include mq-min($breakpoint-large) {
|
|
563
|
+
.p-content-card--cols-8 & {
|
|
564
|
+
grid-column: 2;
|
|
565
|
+
grid-row: 1 / -1;
|
|
566
|
+
height: 100%;
|
|
567
|
+
padding: 0.5rem;
|
|
568
|
+
padding-bottom: 0;
|
|
569
|
+
width: 100%;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
460
573
|
@include mq-min($breakpoint-small) {
|
|
461
574
|
.p-content-card--cols-4 &,
|
|
462
575
|
.p-content-card--cols-6 & {
|
|
@@ -465,6 +578,12 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
465
578
|
width: $card-image-width;
|
|
466
579
|
}
|
|
467
580
|
}
|
|
581
|
+
|
|
582
|
+
@include mq-max($breakpoint-large) {
|
|
583
|
+
.p-content-card--cols-8 & {
|
|
584
|
+
padding: 0rem 0.5rem 1rem 0.5rem;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
468
587
|
}
|
|
469
588
|
|
|
470
589
|
&__author-and-date {
|
|
@@ -508,14 +627,14 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
508
627
|
}
|
|
509
628
|
|
|
510
629
|
@include mq-min($breakpoint-large) {
|
|
511
|
-
&.has-desc:hover .p-content-card__primary-content,
|
|
512
|
-
&.has-desc:focus-within .p-content-card__primary-content {
|
|
630
|
+
&.has-desc:not(.p-content-card--cols-8):hover .p-content-card__primary-content,
|
|
631
|
+
&.has-desc:not(.p-content-card--cols-8):focus-within .p-content-card__primary-content {
|
|
513
632
|
opacity: 0;
|
|
514
633
|
transform: translateY(-150px);
|
|
515
634
|
}
|
|
516
635
|
|
|
517
|
-
&.has-desc:hover .p-content-card__hover-content,
|
|
518
|
-
&.has-desc:focus-within .p-content-card__hover-content {
|
|
636
|
+
&.has-desc:not(.p-content-card--cols-8):hover .p-content-card__hover-content,
|
|
637
|
+
&.has-desc:not(.p-content-card--cols-8):focus-within .p-content-card__hover-content {
|
|
519
638
|
opacity: 1;
|
|
520
639
|
transform: translateY(0);
|
|
521
640
|
}
|
|
@@ -525,5 +644,77 @@ $card-fallback-image-gap: $sp-small + $sp-xx-small;
|
|
|
525
644
|
outline: 3px solid var(--color-focus, #0066cc);
|
|
526
645
|
outline-offset: 2px;
|
|
527
646
|
}
|
|
647
|
+
|
|
648
|
+
/* Forces image above content on all breakpoints,
|
|
649
|
+
overriding horizontal and grid layouts.*/
|
|
650
|
+
@include mq-min($breakpoint-small) {
|
|
651
|
+
&.p-content-card--image-top.p-content-card--cols-4,
|
|
652
|
+
&.p-content-card--image-top.p-content-card--cols-6 {
|
|
653
|
+
flex-direction: column;
|
|
654
|
+
height: auto;
|
|
655
|
+
min-height: $card-height-vertical;
|
|
656
|
+
padding: 0;
|
|
657
|
+
padding-top: var(--spacing-vertical-large, $sp-medium);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
&.p-content-card--image-top.p-content-card--cols-4 .p-content-card__image-wrapper,
|
|
661
|
+
&.p-content-card--image-top.p-content-card--cols-6 .p-content-card__image-wrapper {
|
|
662
|
+
flex: unset;
|
|
663
|
+
width: 100%;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
&.p-content-card--image-top.p-content-card--cols-4 .p-content-card__image,
|
|
667
|
+
&.p-content-card--image-top.p-content-card--cols-6 .p-content-card__image {
|
|
668
|
+
height: auto;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
&.p-content-card--image-top.p-content-card--cols-4 .p-content-card__body,
|
|
672
|
+
&.p-content-card--image-top.p-content-card--cols-6 .p-content-card__body {
|
|
673
|
+
padding: 0 $sp-medium;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
&.p-content-card--image-top.p-content-card--cols-4 .p-content-card__footer-outer,
|
|
677
|
+
&.p-content-card--image-top.p-content-card--cols-6 .p-content-card__footer-outer {
|
|
678
|
+
padding: 0 $sp-medium var(--spacing-vertical-small, $sp-small) $sp-medium;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
&.p-content-card--image-top.p-content-card--cols-4:not(.has-image),
|
|
682
|
+
&.p-content-card--image-top.p-content-card--cols-6:not(.has-image) {
|
|
683
|
+
height: $card-height-default;
|
|
684
|
+
min-height: $card-height-default;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
@include mq-min($breakpoint-large) {
|
|
689
|
+
&.p-content-card--image-top.p-content-card--cols-6 {
|
|
690
|
+
height: auto;
|
|
691
|
+
min-height: $card-height-vertical;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
&.p-content-card--image-top.p-content-card--cols-8.has-image {
|
|
695
|
+
display: flex;
|
|
696
|
+
flex-direction: column;
|
|
697
|
+
min-height: $card-height-8col;
|
|
698
|
+
padding-top: 0;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
&.p-content-card--image-top.p-content-card--cols-8.has-image .p-content-card__image-wrapper {
|
|
702
|
+
grid-column: unset;
|
|
703
|
+
grid-row: unset;
|
|
704
|
+
height: auto;
|
|
705
|
+
padding: 0;
|
|
706
|
+
padding-bottom: var(--spacing-vertical-large, $sp-medium);
|
|
707
|
+
width: 100%;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
&.p-content-card--image-top.p-content-card--cols-8.has-image .p-content-card__image {
|
|
711
|
+
aspect-ratio: 16/9;
|
|
712
|
+
height: auto;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
&.p-content-card--image-top.p-content-card--cols-8.has-image .p-content-card__content {
|
|
716
|
+
grid-column: unset;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
528
719
|
}
|
|
529
720
|
}
|
|
@@ -262,6 +262,9 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
262
262
|
|
|
263
263
|
display: grid;
|
|
264
264
|
|
|
265
|
+
// --columns is set in the container queries above
|
|
266
|
+
grid-template-columns: repeat(var(--columns), 1fr);
|
|
267
|
+
|
|
265
268
|
@container (width >= #{$horizontal-list-section-medium-content-width}) {
|
|
266
269
|
grid-gap: 0 map-get($grid-gutter-widths, default);
|
|
267
270
|
}
|
|
@@ -282,9 +285,6 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
282
285
|
}
|
|
283
286
|
}
|
|
284
287
|
|
|
285
|
-
// --columns is set in the container queries above
|
|
286
|
-
grid-template-columns: repeat(var(--columns), 1fr);
|
|
287
|
-
|
|
288
288
|
.p-list__item {
|
|
289
289
|
@extend %vf-list-item;
|
|
290
290
|
@include vf-list-item-icon-divisor-offset;
|
package/scss/_patterns_suru.scss
CHANGED
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
// same as %section-padding--default
|
|
83
83
|
padding-bottom: $spv--strip-regular * 0.5;
|
|
84
84
|
|
|
85
|
+
// padding top based on p-section--hero
|
|
86
|
+
padding-top: $spv--large;
|
|
87
|
+
|
|
85
88
|
@media (min-width: $breakpoint-large) {
|
|
86
89
|
padding-bottom: $spv--strip-regular;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
// padding top based on p-section--hero
|
|
90
|
-
padding-top: $spv--large;
|
|
91
|
-
|
|
92
92
|
// on large screens, same as %section-padding--shallow
|
|
93
93
|
@media (min-width: $breakpoint-large) {
|
|
94
94
|
padding-top: $spv--x-large;
|
|
@@ -1,36 +1,43 @@
|
|
|
1
1
|
{#
|
|
2
2
|
All Params
|
|
3
|
-
columns: Grid column span for the card. Options are 2, 4, 6. Default is 2.
|
|
3
|
+
columns: Grid column span for the card. Options are 2, 4, 6, 8. Default is 2.
|
|
4
4
|
heading: H4 title text. Truncated at 3 lines. Required.
|
|
5
5
|
link: Link to referenced item. Makes the entire card clickable. Required.
|
|
6
|
-
image: Dictionary containing 'src' and 'alt' for the 16:9 image. Required for col-6.
|
|
6
|
+
image: Dictionary containing 'src' and 'alt' for the 16:9 image. Required for col-6 and col-8.
|
|
7
7
|
author: Optional string for the author's name. Hidden if no image is provided.
|
|
8
8
|
date: Optional string for the publication date. Hidden if no image is provided.
|
|
9
9
|
footer: Dictionary containing 'resource_type' (icon and text) and 'content_type' (read-only chip).
|
|
10
|
-
description: Optional text
|
|
10
|
+
description: Optional text. For col-2/4/6 slides up on hover (4 lines; 2 for col-6). For col-8 always visible below the heading (3 lines desktop/tablet, 2 lines mobile).
|
|
11
11
|
|
|
12
12
|
Variants:
|
|
13
13
|
col-2: 2-column width card layout (Vertical)
|
|
14
14
|
Params: columns (2), heading (req), link (req), image (opt), author (opt, hidden if no image), date (opt, hidden if no image), footer (opt), description (opt)
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
col-4: 4-column width card layout (Horizontal)
|
|
17
17
|
Params: columns (4), heading (req), link (req), image (opt), footer (opt), description (opt)
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
col-6: 6-column width card layout (Horizontal)
|
|
20
20
|
Params: columns (6), heading (req), link (req), image (req), author (opt), date (opt), footer (opt), description (opt)
|
|
21
|
+
|
|
22
|
+
col-8: 8-column (full-width) card layout (50/50 horizontal on desktop, vertical stack on mobile/tablet)
|
|
23
|
+
Heading uses h4 with p-heading--1 styling. Image appears on the right on desktop, above heading on mobile/tablet.
|
|
24
|
+
Params: columns (8), heading (req), link (req), image (req), author (opt), date (opt), footer (opt), description (opt)
|
|
21
25
|
#}
|
|
22
26
|
|
|
23
|
-
{%- macro vf_card(columns="2", link=None, heading=None, image=None, author=None, date=None, footer=None, description=None) -%}
|
|
27
|
+
{%- macro vf_card(columns="2", link=None, heading=None, image=None, author=None, date=None, footer=None, description=None, stacked_image=False) -%}
|
|
24
28
|
|
|
25
29
|
{%- set col_str = columns | string -%}
|
|
26
30
|
{%- set layout = 'p-content-card--cols-' ~ col_str -%}
|
|
27
31
|
{%- set img_class = 'has-image' if image else '' -%}
|
|
28
32
|
{%- set has_desc = 'has-desc' if description else '' -%}
|
|
33
|
+
{%- set heading_extra_class = 'p-heading--1 ' if col_str == '8' else '' -%}
|
|
34
|
+
{%- set stacked_image_class = 'p-content-card--image-top' if stacked_image else '' -%}
|
|
35
|
+
{%- set content_types = [footer.content_type] if footer.content_type is string else footer.content_type -%}
|
|
29
36
|
|
|
30
37
|
<div class="p-content-card-wrapper p-content-card-wrapper--{{ col_str }}">
|
|
31
|
-
|
|
32
|
-
<div class="p-content-card {{ layout }} {{ img_class }} {{ has_desc }}">
|
|
33
|
-
|
|
38
|
+
|
|
39
|
+
<div class="p-content-card {{ layout }} {{ img_class }} {{ has_desc }} {{ stacked_image_class }}">
|
|
40
|
+
|
|
34
41
|
{%- if link -%}
|
|
35
42
|
<a href="{{ link }}" class="p-content-card__overlay-link" tabindex="-1" aria-hidden="true"></a>
|
|
36
43
|
{%- endif -%}
|
|
@@ -43,16 +50,16 @@
|
|
|
43
50
|
|
|
44
51
|
<div class="p-content-card__content">
|
|
45
52
|
<div class="p-content-card__body">
|
|
46
|
-
|
|
53
|
+
|
|
47
54
|
<div class="p-content-card__primary-content">
|
|
48
|
-
<h4 class="p-content-card__heading">
|
|
55
|
+
<h4 class="{{ heading_extra_class }}p-content-card__heading">
|
|
49
56
|
{%- if link -%}
|
|
50
57
|
<a href="{{ link }}" class="p-content-card__main-link">{{ heading }}</a>
|
|
51
58
|
{%- else -%}
|
|
52
59
|
{{ heading }}
|
|
53
60
|
{%- endif -%}
|
|
54
61
|
</h4>
|
|
55
|
-
|
|
62
|
+
|
|
56
63
|
{%- if image and (author or date) -%}
|
|
57
64
|
<div class="p-content-card__author-and-date u-sv-3">
|
|
58
65
|
<small>
|
|
@@ -72,7 +79,7 @@
|
|
|
72
79
|
{%- endif -%}
|
|
73
80
|
|
|
74
81
|
</div>
|
|
75
|
-
|
|
82
|
+
|
|
76
83
|
{%- if footer -%}
|
|
77
84
|
<div class="p-content-card__footer-container">
|
|
78
85
|
<hr class="p-rule--muted">
|
|
@@ -86,7 +93,9 @@
|
|
|
86
93
|
{%- endif -%}
|
|
87
94
|
|
|
88
95
|
{%- if footer.content_type %}
|
|
89
|
-
|
|
96
|
+
{%- for type in content_types -%}
|
|
97
|
+
<span class="p-chip--information u-no-margin--right is-readonly">{{ type }}</span>
|
|
98
|
+
{%- endfor -%}
|
|
90
99
|
{%- endif -%}
|
|
91
100
|
</div>
|
|
92
101
|
</div>
|
|
@@ -95,4 +104,5 @@
|
|
|
95
104
|
</div>
|
|
96
105
|
</div>
|
|
97
106
|
</div>
|
|
107
|
+
|
|
98
108
|
{%- endmacro -%}
|
|
@@ -66,6 +66,15 @@
|
|
|
66
66
|
{%- if has_two_top_cols -%}
|
|
67
67
|
</div>
|
|
68
68
|
{%- endif -%}
|
|
69
|
+
{%- if has_cta -%}
|
|
70
|
+
<div class="grid-row">
|
|
71
|
+
<div class="grid-col-4 grid-col-medium-2 grid-col-start-large-5">
|
|
72
|
+
<p>
|
|
73
|
+
{{- cta_content -}}
|
|
74
|
+
</p>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
{%- endif -%}
|
|
69
78
|
</div>
|
|
70
79
|
|
|
71
80
|
<div class="grid-row">
|
|
@@ -80,15 +89,5 @@
|
|
|
80
89
|
) }}
|
|
81
90
|
</div>
|
|
82
91
|
</div>
|
|
83
|
-
{%- if has_cta -%}
|
|
84
|
-
<div class="grid-row">
|
|
85
|
-
<hr class="p-rule--muted">
|
|
86
|
-
<div class="grid-col-4 grid-col-medium-2 grid-col-start-large-5 grid-col-start-medium-3">
|
|
87
|
-
<p>
|
|
88
|
-
{{- cta_content -}}
|
|
89
|
-
</p>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
{%- endif -%}
|
|
93
92
|
</div>
|
|
94
93
|
{%- endmacro -%}
|
|
@@ -4,16 +4,20 @@
|
|
|
4
4
|
# is_list_full_width_on_tablet: whether list title/description each have their
|
|
5
5
|
# own row on tablet vs. 50/50 split between title/description
|
|
6
6
|
# padding: Type of padding to apply. Options are "deep", "shallow", "default". Default is "default".
|
|
7
|
+
# top_rule_variant: Variant of the horizontal rule rendered at the top of the pattern.
|
|
8
|
+
# Options are "default", "muted", "highlighted", "none". Default is "default".
|
|
7
9
|
# Slots
|
|
8
10
|
# title: top-level title element
|
|
9
11
|
# description: top-level description element
|
|
10
12
|
# list_item_title_[1-25]: title element of each child list item
|
|
11
13
|
# list_item_description_[1-25]: description element of each child list item
|
|
12
14
|
# cta: CTA block element
|
|
15
|
+
{% from "_macros/shared/vf_section_top_rule.jinja" import vf_section_top_rule %}
|
|
13
16
|
{% macro vf_tiered_list(
|
|
14
17
|
padding="default",
|
|
15
18
|
is_description_full_width_on_desktop=true,
|
|
16
|
-
is_list_full_width_on_tablet=true
|
|
19
|
+
is_list_full_width_on_tablet=true,
|
|
20
|
+
top_rule_variant="default") -%}
|
|
17
21
|
{%- set title_content = caller('title') -%}
|
|
18
22
|
{%- set description_content = caller('description') -%}
|
|
19
23
|
{%- set has_description = description_content|trim|length > 0 -%}
|
|
@@ -30,7 +34,7 @@
|
|
|
30
34
|
{%- endif -%}
|
|
31
35
|
|
|
32
36
|
<div class="{{ padding_classes }} u-fixed-width">
|
|
33
|
-
|
|
37
|
+
{{ vf_section_top_rule(top_rule_variant) }}
|
|
34
38
|
<div class="p-section--shallow">
|
|
35
39
|
{% if has_description == true -%}
|
|
36
40
|
{%- if is_description_full_width_on_desktop == true -%}
|
|
@@ -54,6 +58,15 @@
|
|
|
54
58
|
</div>
|
|
55
59
|
</div>
|
|
56
60
|
{%- endif -%}
|
|
61
|
+
{% if has_cta == true -%}
|
|
62
|
+
<div class="grid-row">
|
|
63
|
+
<div class="grid-col-4 grid-col-start-large-5">
|
|
64
|
+
<p>
|
|
65
|
+
{{ cta_content }}
|
|
66
|
+
</p>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
{%- endif %}
|
|
57
70
|
{%- else -%}
|
|
58
71
|
<div class="u-fixed-width">
|
|
59
72
|
{{ title_content }}
|
|
@@ -65,9 +78,6 @@
|
|
|
65
78
|
When there is a CTA, we use shallow spacing to space the list away from the CTA.
|
|
66
79
|
When there is no CTA, shallow spacing would combine with the pattern-level p-section padding, which introduces too much space.
|
|
67
80
|
-#}
|
|
68
|
-
{%- if has_cta -%}
|
|
69
|
-
<div class="p-section--shallow">
|
|
70
|
-
{%- endif -%}
|
|
71
81
|
{%- for number in range(1, 25) -%}
|
|
72
82
|
{%- set list_item_title_content = caller('list_item_title_' + number|string) -%}
|
|
73
83
|
{%- set has_title_content = list_item_title_content|trim|length > 0 -%}
|
|
@@ -114,19 +124,5 @@
|
|
|
114
124
|
{%- endif -%}
|
|
115
125
|
{%- endif -%}
|
|
116
126
|
{% endfor %}
|
|
117
|
-
{%- if has_cta -%}
|
|
118
|
-
</div>
|
|
119
|
-
{%- endif -%}
|
|
120
|
-
|
|
121
|
-
{% if has_cta == true -%}
|
|
122
|
-
<div class="grid-row">
|
|
123
|
-
<hr class="p-rule--muted">
|
|
124
|
-
<div class="grid-col-4 grid-col-start-large-5">
|
|
125
|
-
<p>
|
|
126
|
-
{{ cta_content }}
|
|
127
|
-
</p>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
{%- endif %}
|
|
131
127
|
</div>
|
|
132
128
|
{%- endmacro %}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
// if it's a demo, use local build.css for better QA, otherwise use latest published Vanilla
|
|
68
68
|
/demos\.haus$/.test(window.location.host)
|
|
69
69
|
? `${window.location.origin}/static/build/css/build.css`
|
|
70
|
-
: 'https://assets.ubuntu.com/v1/vanilla_framework_version_' + VANILLA_VERSION
|
|
70
|
+
: 'https://assets.ubuntu.com/v1/vanilla_framework_version_' + VANILLA_VERSION + '.min.css',
|
|
71
71
|
// link to example stylesheet (to set margin on body)
|
|
72
72
|
'https://assets.ubuntu.com/v1/4653d9ba-example.css',
|
|
73
73
|
],
|