vanilla-framework 4.15.0 → 4.17.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.
Files changed (47) hide show
  1. package/package.json +17 -13
  2. package/scss/_base_button.scss +1 -1
  3. package/scss/_base_details.scss +1 -1
  4. package/scss/_base_forms.scss +8 -2
  5. package/scss/_base_hr.scss +2 -3
  6. package/scss/_base_icon-definitions.scss +629 -0
  7. package/scss/_base_links.scss +1 -1
  8. package/scss/_base_placeholders.scss +2 -0
  9. package/scss/_base_typography-definitions.scss +1 -1
  10. package/scss/_global_functions.scss +21 -8
  11. package/scss/_layouts_fluid-breakout.scss +2 -2
  12. package/scss/_patterns_accordion.scss +1 -1
  13. package/scss/_patterns_article-pagination.scss +2 -2
  14. package/scss/_patterns_buttons.scss +1 -1
  15. package/scss/_patterns_chip.scss +68 -68
  16. package/scss/_patterns_code-snippet.scss +1 -1
  17. package/scss/_patterns_contextual-menu.scss +1 -1
  18. package/scss/_patterns_cta.scss +7 -0
  19. package/scss/_patterns_equal-height-row.scss +87 -43
  20. package/scss/_patterns_icons.scss +340 -0
  21. package/scss/_patterns_image.scss +53 -16
  22. package/scss/_patterns_links.scss +6 -5
  23. package/scss/_patterns_list-tree.scss +49 -43
  24. package/scss/_patterns_lists.scss +58 -17
  25. package/scss/_patterns_matrix.scss +2 -2
  26. package/scss/_patterns_navigation.scss +4 -4
  27. package/scss/_patterns_pull-quotes.scss +1 -1
  28. package/scss/_patterns_rule.scss +6 -2
  29. package/scss/_patterns_search-and-filter.scss +11 -12
  30. package/scss/_patterns_separator.scss +1 -0
  31. package/scss/_patterns_side-navigation.scss +1 -1
  32. package/scss/_patterns_status-label.scss +5 -0
  33. package/scss/_patterns_strip.scss +3 -2
  34. package/scss/_patterns_switch.scss +2 -1
  35. package/scss/_patterns_table-mobile-card.scss +1 -1
  36. package/scss/_patterns_tooltips.scss +26 -8
  37. package/scss/_settings_breakpoints.scss +16 -0
  38. package/scss/_settings_colors.scss +20 -15
  39. package/scss/_settings_placeholders.scss +4 -3
  40. package/scss/_utilities_baseline-grid.scss +3 -2
  41. package/scss/_utilities_content-align.scss +9 -0
  42. package/scss/_utilities_floats.scss +6 -6
  43. package/scss/_utilities_font-metrics.scss +4 -3
  44. package/scss/_utilities_hide.scss +9 -9
  45. package/scss/_utilities_show.scss +3 -3
  46. package/templates/_macros/vf_hero.jinja +186 -0
  47. package/templates/_macros/vf_tiered-list.jinja +115 -0
@@ -6,6 +6,7 @@
6
6
  @include vf-u-align--left;
7
7
  @include vf-u-align--right;
8
8
  @include vf-u-align--bottom;
9
+ @include vf-u-vertical-align--middle;
9
10
  @include vf-u-align--text;
10
11
  }
11
12
 
@@ -33,12 +34,20 @@
33
34
  }
34
35
  }
35
36
 
37
+ // Bottom align flex elements
36
38
  @mixin vf-u-align--bottom {
37
39
  .u-align--bottom {
38
40
  margin-top: auto !important;
39
41
  }
40
42
  }
41
43
 
44
+ // Vertically align inline elements
45
+ @mixin vf-u-vertical-align--middle {
46
+ .u-vertical-align--middle {
47
+ vertical-align: middle !important;
48
+ }
49
+ }
50
+
42
51
  // Separate utility for aligning text
43
52
  @mixin vf-u-align--text {
44
53
  .u-align-text {
@@ -6,19 +6,19 @@
6
6
  float: right !important;
7
7
 
8
8
  &--small {
9
- @media (max-width: $breakpoint-small - 1) {
9
+ @media (width < $breakpoint-small) {
10
10
  float: right !important;
11
11
  }
12
12
  }
13
13
 
14
14
  &--medium {
15
- @media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
15
+ @media ($breakpoint-small <= width < $breakpoint-large) {
16
16
  float: right !important;
17
17
  }
18
18
  }
19
19
 
20
20
  &--large {
21
- @media (min-width: $breakpoint-large) {
21
+ @media ($breakpoint-large <= width) {
22
22
  float: right !important;
23
23
  }
24
24
  }
@@ -28,19 +28,19 @@
28
28
  float: left !important;
29
29
 
30
30
  &--small {
31
- @media (max-width: $breakpoint-small - 1) {
31
+ @media (width < $breakpoint-small) {
32
32
  float: left !important;
33
33
  }
34
34
  }
35
35
 
36
36
  &--medium {
37
- @media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
37
+ @media ($breakpoint-small <= width < $breakpoint-large) {
38
38
  float: left !important;
39
39
  }
40
40
  }
41
41
 
42
42
  &--large {
43
- @media (min-width: $breakpoint-large) {
43
+ @media ($breakpoint-large <= width) {
44
44
  float: left !important;
45
45
  }
46
46
  }
@@ -1,3 +1,4 @@
1
+ @use 'sass:color';
1
2
  @import 'settings_font';
2
3
 
3
4
  @mixin vf-u-visualise-baseline($horizontal-bleed: 2rem) {
@@ -5,9 +6,9 @@
5
6
  position: relative;
6
7
 
7
8
  &::before {
8
- border-bottom-color: transparentize($color-information, 0.5);
9
+ border-bottom-color: color.scale($color-information, $alpha: -50%);
9
10
  border-bottom-style: solid;
10
- border-top-color: transparentize($color-positive, 0.5);
11
+ border-top-color: color.scale($color-positive, $alpha: -50%);
11
12
  border-top-style: solid;
12
13
  border-width: 1px;
13
14
  content: '';
@@ -19,7 +20,7 @@
19
20
  }
20
21
 
21
22
  &::after {
22
- background-color: transparentize($color-negative, 0.5);
23
+ background-color: color.scale($color-negative, $alpha: -50%);
23
24
  content: '';
24
25
  height: 1px;
25
26
  left: -#{$horizontal-bleed};
@@ -21,19 +21,19 @@
21
21
  display: none !important;
22
22
 
23
23
  &--small {
24
- @media (max-width: $breakpoint-small - 1) {
24
+ @media (width < $breakpoint-small) {
25
25
  display: none !important;
26
26
  }
27
27
  }
28
28
 
29
29
  &--medium {
30
- @media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
30
+ @media ($breakpoint-small <= width < $breakpoint-large) {
31
31
  display: none !important;
32
32
  }
33
33
  }
34
34
 
35
35
  &--large {
36
- @media (min-width: $breakpoint-large) {
36
+ @media ($breakpoint-large <= width) {
37
37
  display: none !important;
38
38
  }
39
39
  }
@@ -45,19 +45,19 @@
45
45
  @include vf-hide-table-column;
46
46
 
47
47
  &--small {
48
- @media (max-width: $breakpoint-small - 1) {
48
+ @media (width < $breakpoint-small) {
49
49
  @include vf-hide-table-column;
50
50
  }
51
51
  }
52
52
 
53
53
  &--medium {
54
- @media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
54
+ @media ($breakpoint-small <= width < $breakpoint-large) {
55
55
  @include vf-hide-table-column;
56
56
  }
57
57
  }
58
58
 
59
59
  &--large {
60
- @media (min-width: $breakpoint-large) {
60
+ @media ($breakpoint-large <= width) {
61
61
  @include vf-hide-table-column;
62
62
  }
63
63
  }
@@ -69,19 +69,19 @@
69
69
  display: none !important;
70
70
 
71
71
  &--small {
72
- @media (max-width: $breakpoint-small - 1) {
72
+ @media (width < $breakpoint-small) {
73
73
  display: none !important;
74
74
  }
75
75
  }
76
76
 
77
77
  &--medium {
78
- @media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
78
+ @media ($breakpoint-small <= width < $breakpoint-large) {
79
79
  display: none !important;
80
80
  }
81
81
  }
82
82
 
83
83
  &--large {
84
- @media (min-width: $breakpoint-large) {
84
+ @media ($breakpoint-large <= width) {
85
85
  display: none !important;
86
86
  }
87
87
  }
@@ -6,21 +6,21 @@
6
6
  display: initial !important;
7
7
 
8
8
  &--small {
9
- @media (max-width: $breakpoint-small - 1) {
9
+ @media (width < $breakpoint-small) {
10
10
  display: inherit !important;
11
11
  display: initial !important;
12
12
  }
13
13
  }
14
14
 
15
15
  &--medium {
16
- @media (min-width: $breakpoint-small) and (max-width: $breakpoint-large - 1) {
16
+ @media ($breakpoint-small <= width < $breakpoint-large) {
17
17
  display: inherit !important;
18
18
  display: initial !important;
19
19
  }
20
20
  }
21
21
 
22
22
  &--large {
23
- @media (min-width: $breakpoint-large) {
23
+ @media ($breakpoint-large <= width) {
24
24
  display: inherit !important;
25
25
  display: initial !important;
26
26
  }
@@ -0,0 +1,186 @@
1
+ # Params
2
+ # title_text: Hero title text (required)
3
+ # subtitle_text: Hero subtitle text
4
+ # layout: layout of hero section. Options are '50/50', '50/50-full-width-image', '75/25', '25/75', 'fallback'
5
+ # is_split_on_medium: whether the layout is split on tablet in 50/50, 25/75, and 75/25 layouts.
6
+ # If false, the layout is stacked on tablet.
7
+ # If true, the layout is split on tablet.
8
+ # Slots
9
+ # description: paragraph-style content below the title and subtitle
10
+ # cta: call-to-action block below the description
11
+ # image: slot for image content
12
+ # signpost_image: slot for signpost (left column) image content in 25/75 layout. Required for 25/75 layout.
13
+ {% macro vf_hero(
14
+ title_text,
15
+ subtitle_text='',
16
+ layout="fallback",
17
+ is_split_on_medium=false
18
+ ) -%}
19
+ {% set has_subtitle = subtitle_text|trim|length > 0 %}
20
+ {% set description_content = caller('description') %}
21
+ {% set has_description = description_content|trim|length > 0 %}
22
+ {% set cta_content = caller('cta') %}
23
+ {% set has_cta = cta_content|trim|length > 0 %}
24
+ {% set image_content = caller('image') %}
25
+ {% set has_image = image_content|trim|length > 0 %}
26
+ {% set signpost_image_content = caller('signpost_image') %}
27
+ {% set has_signpost_image = signpost_image_content|trim|length > 0 %}
28
+
29
+ {#- User can pass layout as "X-Y" or "X/Y" -#}
30
+ {% set layout = layout | trim | replace('/', '-') %}
31
+ {% if layout not in ['50-50', '50-50-full-width-image', '75-25', '25-75', 'fallback'] %}
32
+ {% set layout = 'fallback' %}
33
+ {% endif %}
34
+
35
+ {% if layout == '50-50-full-width-image' and has_image %}
36
+ {% set layout = '50-50' %}
37
+ {% set has_full_width_image = true %}
38
+ {% endif %}
39
+
40
+ {% if layout == '25-75' %}
41
+ {% if has_signpost_image %}
42
+ {% if has_image %}
43
+ {#- Signpost layouts with images are always full-width -#}
44
+ {% set has_full_width_image = true %}
45
+ {% endif %}
46
+ {% else %}
47
+ {#- 25-75 signpost must include a signpost image. -#}
48
+ {% set layout = 'fallback' %}
49
+ {% endif %}
50
+ {% endif %}
51
+
52
+ {% if layout == 'fallback' %}
53
+ {#- Fallback partially uses 50-50 layout, so set a fallback flag and set layout to 50-50 -#}
54
+ {% set is_fallback = true %}
55
+ {% set layout = '50-50' %}
56
+
57
+ {#- Restrict layout choices to make sure fallback looks consistent -#}
58
+ {% set has_full_width_image = false %}
59
+ {% set is_split_on_medium = false %}
60
+ {% endif %}
61
+
62
+ {#- Construct grid classes from params input -#}
63
+ {% set row_classes = [] %}
64
+ {% set col_classes = ['col', 'col'] %}
65
+ {% if layout in ['50-50', '25-75', '75-25'] %}
66
+ {#- Responsive breakpoint classes were requested -#}
67
+ {% if not is_split_on_medium %}
68
+ {{ row_classes.append('row--' + layout + '-on-large') or "" }}
69
+ {% else %}
70
+ {{ row_classes.append('row--' + layout) or "" }}
71
+ {% endif %}
72
+ {% endif %}
73
+
74
+ {%- macro _hero_title_block() -%}
75
+ {%- if has_full_width_image -%}
76
+ {#- On full-width-image, the h1 and h2 are in separate columns, so there must be no margin-bottom to keep h1 close to h2 on smaller screens -#}
77
+ {% set title_class = "u-no-margin--bottom" %}
78
+ {%- endif -%}
79
+
80
+ {#- Only add a class attribute if needed -#}
81
+ <h1{% if title_class|trim|length > 0 %} class="{{ title_class }}"{% endif %}>
82
+ {{ title_text }}
83
+ </h1>
84
+ {%- endmacro %}
85
+
86
+ {%- macro _hero_subtitle_block() -%}
87
+ {% if has_subtitle %}
88
+ <h2>
89
+ {{ subtitle_text }}
90
+ </h2>
91
+ {% endif %}
92
+ {%- endmacro %}
93
+
94
+ {%- macro _hero_cta_block() -%}
95
+ {% if has_cta -%}
96
+ <div class="p-cta-block">
97
+ {{ cta_content }}
98
+ </div>
99
+ {% endif %}
100
+ {%- endmacro %}
101
+
102
+ {%- macro _hero_description_block() -%}
103
+ {% if has_description %}
104
+ <div class="p-section--shallow">
105
+ {{ description_content }}
106
+ </div>
107
+ {% endif %}
108
+ {%- endmacro %}
109
+
110
+ {%- macro _hero_signpost_image_block() -%}
111
+ {% if layout == '25-75' and has_signpost_image -%}
112
+ <div class="p-section--shallow">
113
+ {{ signpost_image_content }}
114
+ </div>
115
+ {% endif %}
116
+ {%- endmacro %}
117
+
118
+ <section class="p-section--hero">
119
+ {% if is_fallback -%}
120
+ <div class="row">
121
+ <div class="col">
122
+ <div class="p-section--shallow">
123
+ {{ _hero_title_block() -}}
124
+ {{ _hero_subtitle_block() -}}
125
+ </div>
126
+ </div>
127
+ </div>
128
+ {% endif -%}
129
+ <div class="{{ row_classes | join(' ') }}">
130
+ {%- if is_fallback -%}
131
+ <div class="{{ col_classes[0] }}">
132
+ {{- _hero_description_block() -}}
133
+ {{ _hero_cta_block() -}}
134
+ </div>
135
+ {% if has_image -%}
136
+ <div class="{{ col_classes[1] }}">
137
+ {{ image_content }}
138
+ </div>
139
+ {% endif -%}
140
+ {% elif has_full_width_image and not has_signpost_image %}
141
+ <div class="{{ col_classes[0] }}">
142
+ {{ _hero_title_block() }}
143
+ </div>
144
+ <div class="{{ col_classes[1] }}">
145
+ <div class="p-section--shallow">
146
+ {{- _hero_subtitle_block() -}}
147
+ </div>
148
+ {{- _hero_description_block() -}}
149
+ {{- _hero_cta_block() -}}
150
+ </div>
151
+ {{ image_content -}}
152
+ {% elif has_signpost_image %}
153
+ {#- 25/75 Signpost layout -#}
154
+ <div class="{{ col_classes[0] }}">
155
+ {{ _hero_signpost_image_block() -}}
156
+ </div>
157
+ <div class="{{ col_classes[1] }}">
158
+ <div class="p-section--shallow">
159
+ {{ _hero_title_block() -}}
160
+ {{ _hero_subtitle_block() -}}
161
+ </div>
162
+ {{- _hero_description_block() -}}
163
+ {{- _hero_cta_block() -}}
164
+ </div>
165
+ {% if has_image %}
166
+ {#- Signpost with image is always full-width, so set it after the columns -#}
167
+ {{- image_content }}
168
+ {% endif -%}
169
+ {% else %}
170
+ <div class="{{ col_classes[0] }}">
171
+ <div class="p-section--shallow">
172
+ {{ _hero_title_block() -}}
173
+ {{ _hero_subtitle_block() -}}
174
+ </div>
175
+ {{- _hero_description_block() -}}
176
+ {{- _hero_cta_block() -}}
177
+ </div>
178
+ {% if has_image -%}
179
+ <div class="{{ col_classes[1] }}">
180
+ {{ image_content }}
181
+ </div>
182
+ {% endif -%}
183
+ {% endif -%}
184
+ </div>
185
+ </section>
186
+ {%- endmacro %}
@@ -0,0 +1,115 @@
1
+ # Params
2
+ # is_description_full_width_on_desktop: whether description has its own row on
3
+ # desktop vs. 50/50 split between title/description
4
+ # is_list_full_width_on_tablet: whether list title/description each have their
5
+ # own row on tablet vs. 50/50 split between title/description
6
+ # Slots
7
+ # title: top-level title element
8
+ # description: top-level description element
9
+ # list_item_title_[1-25]: title element of each child list item
10
+ # list_item_description_[1-25]: description element of each child list item
11
+ # cta: CTA block element
12
+ {% macro vf_tiered_list(
13
+ is_description_full_width_on_desktop=true,
14
+ is_list_full_width_on_tablet=true) -%}
15
+ {%- set title_content = caller('title') -%}
16
+ {%- set description_content = caller('description') -%}
17
+ {%- set has_description = description_content|trim|length > 0 -%}
18
+ {%- set cta_content = caller('cta') -%}
19
+ {%- set has_cta = cta_content|trim|length > 0 -%}
20
+
21
+ <div class="u-fixed-width">
22
+ <hr class="u-hide--small">
23
+
24
+ {% if has_description == true -%}
25
+ {%- if is_description_full_width_on_desktop == true -%}
26
+ <div class="u-fixed-width">
27
+ <div class="p-section--shallow">
28
+ {{ title_content }}
29
+ </div>
30
+ </div>
31
+
32
+ <div class="row">
33
+ <div class="col-6 col-start-large-7">
34
+ {{ description_content }}
35
+ </div>
36
+ </div>
37
+ {%- else -%}
38
+ <div class="row">
39
+ <div class="col-6">
40
+ <div class="p-section--shallow">
41
+ {{ title_content }}
42
+ </div>
43
+ </div>
44
+
45
+ <div class="col-6">
46
+ {{ description_content }}
47
+ </div>
48
+ </div>
49
+ {%- endif -%}
50
+ {%- else -%}
51
+ <div class="u-fixed-width">
52
+ <div class="p-section--shallow">
53
+ {{ title_content }}
54
+ </div>
55
+ </div>
56
+ {%- endif %}
57
+
58
+ <div class="p-section--shallow">
59
+ {%- for number in range(1, 25) -%}
60
+ {%- set list_item_title_content = caller('list_item_title_' + number|string) -%}
61
+ {%- set has_title_content = list_item_title_content|trim|length > 0 -%}
62
+ {%- set list_item_description_content = caller('list_item_description_' + number|string) -%}
63
+ {%- set has_description_content = list_item_description_content|trim|length > 0 -%}
64
+
65
+ {#- Check to see if title/description content exist, since we're
66
+ iterating through 25 potential list items -#}
67
+ {%- if has_title_content and has_description_content -%}
68
+ {%- if is_list_full_width_on_tablet == true %}
69
+ <div class="row">
70
+ <div class="col-9 col-start-large-4">
71
+ <hr class="is-muted">
72
+ </div>
73
+ </div>
74
+
75
+ <div class="row">
76
+ <div class="col-3 col-start-large-4">
77
+ {{ list_item_title_content }}
78
+ </div>
79
+
80
+ <div class="col-6">
81
+ {{ list_item_description_content }}
82
+ </div>
83
+ </div>
84
+ {%- else %}
85
+ <div class="row">
86
+ <div class="col-9 col-start-large-4">
87
+ <hr class="is-muted">
88
+ </div>
89
+ </div>
90
+
91
+ <div class="row">
92
+ <div class="col-medium-3 col-3 col-start-large-4">
93
+ {{ list_item_title_content }}
94
+ </div>
95
+
96
+ <div class="col-medium-3 col-6">
97
+ {{ list_item_description_content }}
98
+ </div>
99
+ </div>
100
+ {%- endif -%}
101
+ {%- endif -%}
102
+ {% endfor %}
103
+ </div>
104
+
105
+ {% if has_cta == true -%}
106
+ <div class="p-cta-block">
107
+ <div class="row">
108
+ <div class="col-6 col-start-large-7">
109
+ {{ cta_content }}
110
+ </div>
111
+ </div>
112
+ </div>
113
+ {%- endif %}
114
+ </div>
115
+ {%- endmacro %}