vanilla-framework 4.52.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
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
Modifier for a 6-column width horizontal layout. Applied ONLY to the parent .p-content-card.
|
|
13
13
|
"&.p-content-card--cols-8":
|
|
14
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.
|
|
15
17
|
"&.has-image":
|
|
16
18
|
State class applied to the parent when the card includes an image.
|
|
17
19
|
"&.has-desc":
|
|
@@ -642,5 +644,77 @@ $card-height-8col: 22rem;
|
|
|
642
644
|
outline: 3px solid var(--color-focus, #0066cc);
|
|
643
645
|
outline-offset: 2px;
|
|
644
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
|
+
}
|
|
645
719
|
}
|
|
646
720
|
}
|
|
@@ -24,17 +24,19 @@
|
|
|
24
24
|
Params: columns (8), heading (req), link (req), image (req), author (opt), date (opt), footer (opt), description (opt)
|
|
25
25
|
#}
|
|
26
26
|
|
|
27
|
-
{%- 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) -%}
|
|
28
28
|
|
|
29
29
|
{%- set col_str = columns | string -%}
|
|
30
30
|
{%- set layout = 'p-content-card--cols-' ~ col_str -%}
|
|
31
31
|
{%- set img_class = 'has-image' if image else '' -%}
|
|
32
32
|
{%- set has_desc = 'has-desc' if description else '' -%}
|
|
33
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 -%}
|
|
34
36
|
|
|
35
37
|
<div class="p-content-card-wrapper p-content-card-wrapper--{{ col_str }}">
|
|
36
38
|
|
|
37
|
-
<div class="p-content-card {{ layout }} {{ img_class }} {{ has_desc }}">
|
|
39
|
+
<div class="p-content-card {{ layout }} {{ img_class }} {{ has_desc }} {{ stacked_image_class }}">
|
|
38
40
|
|
|
39
41
|
{%- if link -%}
|
|
40
42
|
<a href="{{ link }}" class="p-content-card__overlay-link" tabindex="-1" aria-hidden="true"></a>
|
|
@@ -91,7 +93,9 @@
|
|
|
91
93
|
{%- endif -%}
|
|
92
94
|
|
|
93
95
|
{%- if footer.content_type %}
|
|
94
|
-
|
|
96
|
+
{%- for type in content_types -%}
|
|
97
|
+
<span class="p-chip--information u-no-margin--right is-readonly">{{ type }}</span>
|
|
98
|
+
{%- endfor -%}
|
|
95
99
|
{%- endif -%}
|
|
96
100
|
</div>
|
|
97
101
|
</div>
|
|
@@ -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 -%}
|
|
@@ -58,6 +58,15 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
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 %}
|
|
61
70
|
{%- else -%}
|
|
62
71
|
<div class="u-fixed-width">
|
|
63
72
|
{{ title_content }}
|
|
@@ -69,9 +78,6 @@
|
|
|
69
78
|
When there is a CTA, we use shallow spacing to space the list away from the CTA.
|
|
70
79
|
When there is no CTA, shallow spacing would combine with the pattern-level p-section padding, which introduces too much space.
|
|
71
80
|
-#}
|
|
72
|
-
{%- if has_cta -%}
|
|
73
|
-
<div class="p-section--shallow">
|
|
74
|
-
{%- endif -%}
|
|
75
81
|
{%- for number in range(1, 25) -%}
|
|
76
82
|
{%- set list_item_title_content = caller('list_item_title_' + number|string) -%}
|
|
77
83
|
{%- set has_title_content = list_item_title_content|trim|length > 0 -%}
|
|
@@ -118,19 +124,5 @@
|
|
|
118
124
|
{%- endif -%}
|
|
119
125
|
{%- endif -%}
|
|
120
126
|
{% endfor %}
|
|
121
|
-
{%- if has_cta -%}
|
|
122
|
-
</div>
|
|
123
|
-
{%- endif -%}
|
|
124
|
-
|
|
125
|
-
{% if has_cta == true -%}
|
|
126
|
-
<div class="grid-row">
|
|
127
|
-
<hr class="p-rule--muted">
|
|
128
|
-
<div class="grid-col-4 grid-col-start-large-5">
|
|
129
|
-
<p>
|
|
130
|
-
{{ cta_content }}
|
|
131
|
-
</p>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
{%- endif %}
|
|
135
127
|
</div>
|
|
136
128
|
{%- endmacro %}
|