vanilla-framework 4.7.0 → 4.9.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 (46) hide show
  1. package/package.json +8 -8
  2. package/scss/_base.scss +2 -0
  3. package/scss/_base_background.scss +2 -6
  4. package/scss/_base_button.scss +8 -8
  5. package/scss/_base_code.scss +5 -5
  6. package/scss/_base_forms.scss +22 -103
  7. package/scss/_base_grid-definitions.scss +4 -4
  8. package/scss/_base_hr.scss +5 -39
  9. package/scss/_base_icon-definitions.scss +361 -54
  10. package/scss/_base_links.scss +2 -10
  11. package/scss/_base_placeholders.scss +1 -1
  12. package/scss/_base_syntax-highlighting.scss +2 -2
  13. package/scss/_base_tables.scss +2 -2
  14. package/scss/_base_themes.scss +52 -0
  15. package/scss/_base_typography-definitions.scss +1 -1
  16. package/scss/_global_functions.scss +10 -0
  17. package/scss/_layouts_application-panels.scss +1 -1
  18. package/scss/_patterns_buttons.scss +35 -167
  19. package/scss/_patterns_chip.scss +156 -189
  20. package/scss/_patterns_code-snippet.scss +7 -8
  21. package/scss/_patterns_contextual-menu.scss +16 -75
  22. package/scss/_patterns_divider.scss +5 -35
  23. package/scss/_patterns_form-help-text.scss +1 -29
  24. package/scss/_patterns_form-password-toggle.scss +1 -1
  25. package/scss/_patterns_form-tick-elements.scss +9 -128
  26. package/scss/_patterns_form-validation.scss +31 -229
  27. package/scss/_patterns_icons.scss +623 -442
  28. package/scss/_patterns_links.scss +12 -9
  29. package/scss/_patterns_lists.scss +23 -40
  30. package/scss/_patterns_media-container.scss +5 -0
  31. package/scss/_patterns_notifications.scss +21 -12
  32. package/scss/_patterns_search-box.scss +20 -99
  33. package/scss/_patterns_section.scss +12 -1
  34. package/scss/_patterns_side-navigation-expandable.scss +18 -55
  35. package/scss/_patterns_side-navigation.scss +132 -317
  36. package/scss/_patterns_strip.scss +41 -13
  37. package/scss/_patterns_suru.scss +126 -10
  38. package/scss/_patterns_table-mobile-card.scss +1 -1
  39. package/scss/_patterns_table-sortable.scss +2 -2
  40. package/scss/_patterns_tabs.scss +23 -74
  41. package/scss/_settings_colors.scss +195 -2
  42. package/scss/_settings_themes.scss +6 -6
  43. package/scss/_utilities_baseline-grid.scss +8 -0
  44. package/scss/_utilities_layout.scss +0 -6
  45. package/scss/_utilities_theme-toggle.scss +39 -0
  46. package/scss/_vanilla.scss +4 -0
@@ -2,15 +2,15 @@
2
2
 
3
3
  @mixin vf-p-links {
4
4
  .p-link--soft {
5
- color: $colors--light-theme--text-default;
5
+ color: $colors--theme--text-default;
6
6
 
7
7
  &:visited {
8
- color: $colors--light-theme--text-default;
8
+ color: $colors--theme--text-default;
9
9
  text-decoration: none;
10
10
  }
11
11
 
12
12
  &:hover {
13
- color: $color-link;
13
+ color: $colors--theme--link-default;
14
14
  }
15
15
 
16
16
  &.is-selected {
@@ -18,21 +18,23 @@
18
18
  }
19
19
  }
20
20
 
21
+ // "inverted" links are meant for undefined dark backgrounds
22
+ // and they use the default text color
21
23
  .p-link--inverted {
22
- color: $color-light;
24
+ color: $colors--theme--text-default;
23
25
  font-weight: $font-weight-bold;
24
26
 
25
27
  &:hover {
26
- color: $color-light;
28
+ color: $colors--theme--text-default;
27
29
  }
28
30
 
29
31
  &:visited {
30
- color: darken($color-light, 10%);
32
+ color: $colors--theme--text-muted;
31
33
  }
32
34
  }
33
35
 
34
36
  .p-link--skip {
35
- color: $color-link;
37
+ color: $colors--theme--link-default;
36
38
  display: block;
37
39
  left: -999px;
38
40
  position: absolute;
@@ -54,7 +56,7 @@
54
56
  display: flex;
55
57
 
56
58
  &::before {
57
- border-bottom: 1px solid $colors--light-theme--border-default;
59
+ border-bottom: 1px solid $colors--theme--border-default;
58
60
  content: '';
59
61
  flex-grow: 1;
60
62
  margin: $spv--x-large 0 calc($spv--x-large - 1px) 0;
@@ -62,6 +64,7 @@
62
64
 
63
65
  &::after {
64
66
  @extend %icon;
67
+ // FIXME: to do when icons are themed
65
68
  @include vf-icon-back-to-top($color-mid-dark);
66
69
 
67
70
  content: '';
@@ -70,7 +73,7 @@
70
73
  }
71
74
 
72
75
  .p-top__link {
73
- color: $colors--light-theme--text-default;
76
+ color: $colors--theme--text-default;
74
77
  padding: 0 $sph--small 0 $sph--large;
75
78
  text-decoration: none;
76
79
  }
@@ -3,14 +3,24 @@ $list-status-icon-height: $default-icon-size;
3
3
  $list-step-bullet-margin: $sph--x-large;
4
4
 
5
5
  @mixin vf-p-list-placeholders {
6
+ // container for stepped lists (`ol`)
7
+ // defines the layout and resets the native browser counter
6
8
  %numbered-step-container {
7
- counter-reset: li;
9
+ counter-reset: list-item;
8
10
  display: flex;
9
11
  flex-direction: column;
10
12
  list-style: none;
11
13
  padding-left: 0;
12
14
  }
13
15
 
16
+ // list item for stepped lists (`li`)
17
+ // increments the default browser counter
18
+ %numbered-step-item {
19
+ counter-increment: list-item;
20
+ }
21
+
22
+ // title for stepped lists
23
+ // displays the title and step counter
14
24
  %numbered-step-title {
15
25
  list-style: none;
16
26
  margin-left: 0;
@@ -18,8 +28,7 @@ $list-step-bullet-margin: $sph--x-large;
18
28
  position: relative;
19
29
 
20
30
  &::before {
21
- content: counter(li) '.';
22
- counter-increment: li;
31
+ content: counter(list-item) '.';
23
32
  display: block;
24
33
  height: map-get($line-heights, default-text);
25
34
  left: 0;
@@ -30,6 +39,7 @@ $list-step-bullet-margin: $sph--x-large;
30
39
  }
31
40
  }
32
41
 
42
+ // used with .p-list--nested-counter
33
43
  %nested-counter {
34
44
  // Counter is named and it will be reset for each "ol" element.
35
45
  counter-reset: list-item;
@@ -198,7 +208,7 @@ $list-step-bullet-margin: $sph--x-large;
198
208
 
199
209
  &::before {
200
210
  @extend %vf-list-item-state-base;
201
- @include vf-icon-success-grey($color-mid-dark);
211
+ @include vf-icon-success-grey-themed;
202
212
  }
203
213
  }
204
214
 
@@ -207,7 +217,7 @@ $list-step-bullet-margin: $sph--x-large;
207
217
 
208
218
  &::before {
209
219
  @extend %vf-list-item-state-base;
210
- @include vf-icon-error-grey($color-mid-dark);
220
+ @include vf-icon-error-grey-themed;
211
221
  }
212
222
  }
213
223
 
@@ -256,37 +266,6 @@ $list-step-bullet-margin: $sph--x-large;
256
266
  }
257
267
  }
258
268
  }
259
-
260
- // Theming
261
- @if ($theme-default-p-inline-list--middot == 'dark') {
262
- .p-inline-list--middot {
263
- @include vf-p-inline-list-middot-dark-theme;
264
- }
265
-
266
- .p-inline-list--middot.is-light {
267
- @include vf-p-inline-list-middot-light-theme;
268
- }
269
- } @else {
270
- .p-inline-list--middot {
271
- @include vf-p-inline-list-middot-light-theme;
272
- }
273
-
274
- .p-inline-list--middot.is-dark {
275
- @include vf-p-inline-list-middot-dark-theme;
276
- }
277
- }
278
- }
279
-
280
- @mixin vf-p-inline-list-middot-theme($color-list-text) {
281
- color: $color-list-text;
282
- }
283
-
284
- @mixin vf-p-inline-list-middot-light-theme {
285
- @include vf-p-inline-list-middot-theme($colors--light-theme--text-default);
286
- }
287
-
288
- @mixin vf-p-inline-list-middot-dark-theme {
289
- @include vf-p-inline-list-middot-theme($colors--dark-theme--text-default);
290
269
  }
291
270
 
292
271
  @mixin vf-p-inline-list-stretch {
@@ -314,6 +293,8 @@ $list-step-bullet-margin: $sph--x-large;
314
293
  }
315
294
 
316
295
  .p-stepped-list__item {
296
+ @extend %numbered-step-item;
297
+
317
298
  // override unecessary col-8 class in markup; layout is handled with css below
318
299
  float: none;
319
300
  margin-left: 0;
@@ -387,24 +368,26 @@ $list-step-bullet-margin: $sph--x-large;
387
368
  @mixin vf-p-stepped-list-detailed {
388
369
  .p-stepped-list--detailed {
389
370
  @extend %numbered-step-container;
390
-
391
371
  margin-left: auto;
392
372
 
393
373
  @supports (display: grid) {
394
374
  .p-stepped-list__content {
395
- @media (min-width: $threshold-6-12-col) {
375
+ @media (min-width: $threshold-4-6-col) {
396
376
  grid-column-end: span 6;
397
377
  margin-top: 0;
398
378
  }
399
379
  }
400
380
 
401
381
  .p-stepped-list__title {
402
- grid-column-end: span 6;
403
- margin-left: 0;
382
+ @media (min-width: $threshold-4-6-col) {
383
+ grid-column-end: span 6;
384
+ margin-top: 0;
385
+ }
404
386
  }
405
387
  }
406
388
 
407
389
  .p-stepped-list__item {
390
+ @extend %numbered-step-item;
408
391
  @extend %vf-row;
409
392
  @include vf-b-row-reset;
410
393
 
@@ -0,0 +1,5 @@
1
+ @mixin vf-p-media-container {
2
+ .p-media-container {
3
+ margin-top: $spv--small;
4
+ }
5
+ }
@@ -76,9 +76,12 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
76
76
  @extend %vf-is-bordered;
77
77
  @extend %vf-bg--x-light;
78
78
 
79
+ background: $colors--theme--background-default;
79
80
  background-position: $sph--large $notification-icon-vert-offset;
80
81
  background-repeat: no-repeat;
81
82
  background-size: map-get($icon-sizes, default);
83
+ border-color: $colors--theme--border-default;
84
+ color: $colors--theme--text-default;
82
85
  margin-bottom: $spv--x-large;
83
86
  padding-bottom: calc($spv--small - 1px);
84
87
  padding-left: $notification-content-icon-space;
@@ -90,7 +93,6 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
90
93
  }
91
94
 
92
95
  &.is-borderless {
93
- background-color: transparent;
94
96
  background-position: 0 $borderless-notification-icon-vert-offset;
95
97
  border: none;
96
98
  margin-top: 0;
@@ -145,7 +147,7 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
145
147
 
146
148
  .p-notification__close {
147
149
  @extend %vf-hide-text;
148
- @include vf-icon-close($color-mid-dark);
150
+ @include vf-icon-close-themed;
149
151
 
150
152
  background-color: transparent;
151
153
  background-position: center;
@@ -174,6 +176,8 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
174
176
  .p-notification__timestamp {
175
177
  @extend %default-text;
176
178
  @extend %muted-text;
179
+
180
+ color: $colors--theme--text-muted;
177
181
  }
178
182
 
179
183
  .p-notification__actions {
@@ -187,6 +191,11 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
187
191
 
188
192
  .p-notification__action {
189
193
  @extend %default-text;
194
+ color: $colors--theme--link-default;
195
+
196
+ &:visited {
197
+ color: $colors--theme--link-visited;
198
+ }
190
199
  }
191
200
 
192
201
  .p-notification__action + .p-notification__action {
@@ -205,8 +214,8 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
205
214
  @mixin vf-notifications-default {
206
215
  .p-notification {
207
216
  @extend %vf-notification;
208
- @include vf-highlight-bar($color-information, left, true);
209
- @include vf-icon-info($color-mid-dark);
217
+ @include vf-highlight-bar($colors--theme--border-information, left, true);
218
+ @include vf-icon-info-themed;
210
219
  }
211
220
  }
212
221
 
@@ -214,8 +223,8 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
214
223
  @mixin vf-notifications-positive {
215
224
  .p-notification--positive {
216
225
  @extend %vf-notification;
217
- @include vf-highlight-bar($color-positive, left, true);
218
- @include vf-icon-success;
226
+ @include vf-highlight-bar($colors--theme--border-positive, left, true);
227
+ @include vf-icon-success-themed;
219
228
  }
220
229
  }
221
230
 
@@ -223,8 +232,8 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
223
232
  @mixin vf-notifications-caution {
224
233
  .p-notification--caution {
225
234
  @extend %vf-notification;
226
- @include vf-highlight-bar($color-caution, left, true);
227
- @include vf-icon-warning;
235
+ @include vf-highlight-bar($colors--theme--border-caution, left, true);
236
+ @include vf-icon-warning-themed;
228
237
  }
229
238
  }
230
239
 
@@ -232,8 +241,8 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
232
241
  @mixin vf-notifications-negative {
233
242
  .p-notification--negative {
234
243
  @extend %vf-notification;
235
- @include vf-highlight-bar($color-negative, left, true);
236
- @include vf-icon-error;
244
+ @include vf-highlight-bar($colors--theme--border-negative, left, true);
245
+ @include vf-icon-error-themed;
237
246
  }
238
247
  }
239
248
 
@@ -241,7 +250,7 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
241
250
  @mixin vf-notifications-information {
242
251
  .p-notification--information {
243
252
  @extend %vf-notification;
244
- @include vf-highlight-bar($color-information, left, true);
245
- @include vf-icon-info($color-mid-dark);
253
+ @include vf-highlight-bar($colors--theme--border-information, left, true);
254
+ @include vf-icon-info-themed;
246
255
  }
247
256
  }
@@ -38,13 +38,33 @@
38
38
  }
39
39
  }
40
40
 
41
+ // Theme set on body element
41
42
  .p-search-box__input {
43
+ background-color: $colors--theme--background-inputs;
44
+ border-color: $colors--theme--border-high-contrast;
45
+
46
+ color: $colors--theme--text-default;
42
47
  flex: 1 1 100%;
43
48
  margin-bottom: 0;
44
49
  padding-right: calc(2 * (2 * $spv-nudge + map-get($line-heights, default-text)));
45
50
  position: absolute;
46
51
  right: 0;
47
52
 
53
+ &:hover,
54
+ &:-webkit-autofill:hover {
55
+ background-color: $colors--theme--background-hover !important;
56
+ }
57
+
58
+ &:active,
59
+ &:focus,
60
+ &:-internal-autofill-selected,
61
+ &:-webkit-autofill,
62
+ &:-webkit-autofill:focus {
63
+ // XXX: remove important once the button {} selector is refactored to use themeing. At the moment, it trumps these.
64
+ background-color: $colors--theme--background-active !important;
65
+ border-color: $colors--theme--border-high-contrast !important;
66
+ }
67
+
48
68
  &::-webkit-search-cancel-button {
49
69
  -webkit-appearance: none; // stylelint-disable-line property-no-vendor-prefix
50
70
  }
@@ -64,7 +84,6 @@
64
84
  }
65
85
  }
66
86
 
67
- // Theming
68
87
  %transparent-button {
69
88
  &,
70
89
  &:active,
@@ -74,102 +93,4 @@
74
93
  border-width: 0;
75
94
  }
76
95
  }
77
-
78
- @if ($theme-default-p-search-box == 'dark') {
79
- .p-search-box__input {
80
- @include vf-search-box-dark-theme;
81
- }
82
- } @else {
83
- .p-search-box {
84
- .p-search-box__input {
85
- @include vf-search-box-light-theme;
86
- }
87
- }
88
- }
89
-
90
- // beware that the order of the following classes is important
91
- // as they are used to override the default theme
92
- .is-paper .p-search-box {
93
- .p-search-box__input {
94
- @include vf-search-box-paper-theme;
95
- }
96
- }
97
-
98
- .p-search-box.is-light {
99
- .p-search-box__input {
100
- @include vf-search-box-light-theme;
101
- }
102
- }
103
-
104
- .p-search-box.is-dark {
105
- .p-search-box__input {
106
- @include vf-search-box-dark-theme;
107
- }
108
- }
109
- }
110
-
111
- @mixin vf-search-box-theme(
112
- $color-search-box-background,
113
- $color-search-box-background-hover,
114
- $color-search-box-background-active,
115
- $color-search-box-border,
116
- $color-search-box-text
117
- ) {
118
- //XXX: This should inherit from input color theming. Once that becomes available, delete this.
119
- background-color: $color-search-box-background;
120
- border-color: $color-search-box-border;
121
- color: $color-search-box-text;
122
-
123
- &:hover,
124
- &:-webkit-autofill:hover {
125
- background-color: $color-search-box-background-hover !important;
126
- }
127
-
128
- &:active,
129
- &:focus,
130
- &:-internal-autofill-selected,
131
- &:-webkit-autofill,
132
- &:-webkit-autofill:focus {
133
- // XXX: remove important once the button {} selector is refactored to use themeing. At the moment, it trumps these.
134
- background-color: $color-search-box-background-active !important;
135
- border-color: $color-search-box-border !important;
136
- }
137
- }
138
-
139
- @mixin vf-search-box-light-theme {
140
- @include vf-search-box-theme(
141
- $color-search-box-background: $colors--light-theme--background-inputs,
142
- $color-search-box-background-hover: $colors--light-theme--background-hover,
143
- $color-search-box-background-active: $colors--light-theme--background-active,
144
- $color-search-box-border: $colors--light-theme--border-high-contrast,
145
- $color-search-box-text: $colors--light-theme--text-default
146
- );
147
- }
148
-
149
- @mixin vf-search-box-dark-theme {
150
- @include vf-search-box-theme(
151
- $color-search-box-background: lighten($colors--dark-theme--background-default, 10%),
152
- $color-search-box-background-hover: $colors--dark-theme--background-hover,
153
- $color-search-box-background-active: $colors--dark-theme--background-active,
154
- $color-search-box-border: $color-x-light,
155
- $color-search-box-text: $colors--dark-theme--text-default
156
- );
157
-
158
- &::placeholder {
159
- color: $colors--dark-theme--text-default;
160
- }
161
- }
162
-
163
- @mixin vf-search-box-paper-theme {
164
- // XXX: currently these colours are transparent,
165
- // so they work both on paper and white backgrounds.
166
- // We may need later to add a specific override for
167
- // a white background within paper themed pages.
168
- @include vf-search-box-theme(
169
- $color-search-box-background: $colors--paper-theme--background-inputs,
170
- $color-search-box-background-hover: $colors--paper-theme--background-hover,
171
- $color-search-box-background-active: $colors--paper-theme--background-active,
172
- $color-search-box-border: $colors--light-theme--border-high-contrast,
173
- $color-search-box-text: $colors--light-theme--text-default
174
- );
175
96
  }
@@ -1,5 +1,6 @@
1
1
  @mixin vf-p-section {
2
- .p-section {
2
+ .p-section,
3
+ .p-section--hero {
3
4
  // same as %section-padding--default
4
5
  padding-bottom: $spv--strip-regular * 0.5;
5
6
 
@@ -22,4 +23,14 @@
22
23
  // same as %section-padding--shallow
23
24
  padding-bottom: $spv--x-large;
24
25
  }
26
+
27
+ // hero section has additional top padding (as it appears on the top of the page)
28
+ .p-section--hero {
29
+ padding-top: $spv--large;
30
+
31
+ // on large screens, same as %section-padding--shallow
32
+ @media (min-width: $breakpoint-large) {
33
+ padding-top: $spv--x-large;
34
+ }
35
+ }
25
36
  }
@@ -15,6 +15,7 @@
15
15
  .p-side-navigation__expand {
16
16
  @include vf-button-base;
17
17
  background: none;
18
+ background-color: inherit;
18
19
  border: 0;
19
20
  border-radius: 0;
20
21
  font-size: inherit;
@@ -28,15 +29,29 @@
28
29
 
29
30
  &::before {
30
31
  @extend %icon;
31
- @include vf-icon-chevron;
32
+ @include vf-icon-chevron-themed;
32
33
  content: '';
33
34
  transform: rotate(-90deg);
34
35
  transition: transform 100ms;
35
36
  }
37
+
38
+ &:hover {
39
+ background: $colors--theme--background-hover;
40
+ color: $colors--theme--text-default;
41
+ }
36
42
  }
37
43
 
38
- .p-side-navigation__expand[aria-expanded='true']::before {
39
- transform: rotate(0deg);
44
+ .p-side-navigation__expand[aria-expanded='true'] {
45
+ background-color: inherit;
46
+
47
+ &::before {
48
+ transform: rotate(0deg);
49
+ }
50
+
51
+ &:hover {
52
+ background: $colors--theme--background-hover;
53
+ color: $colors--theme--text-default;
54
+ }
40
55
  }
41
56
 
42
57
  // transition
@@ -59,56 +74,4 @@
59
74
  transform: translate3d(0, 0, 0);
60
75
  visibility: visible;
61
76
  }
62
-
63
- // Theming for the expandable variant
64
- @if ($theme-default-p-side-navigation == 'dark') {
65
- .p-side-navigation,
66
- [class*='p-side-navigation--'] {
67
- @include vf-side-navigation-expandable-theme-dark;
68
-
69
- &.is-light {
70
- @include vf-side-navigation-expandable-theme-light;
71
- }
72
- }
73
- } @else {
74
- .p-side-navigation,
75
- [class*='p-side-navigation--'] {
76
- @include vf-side-navigation-expandable-theme-light;
77
-
78
- &.is-dark {
79
- @include vf-side-navigation-expandable-theme-dark;
80
- }
81
- }
82
- }
83
- }
84
-
85
- @mixin vf-side-navigation-expandable-theme($color-sidenav-text-active, $color-sidenav-item-background-hover, $color-sidenav-toggle-icon) {
86
- .p-side-navigation__expand {
87
- background-color: inherit;
88
- &::before {
89
- @include vf-icon-chevron($color-sidenav-toggle-icon);
90
- }
91
-
92
- &:hover {
93
- background: $color-sidenav-item-background-hover;
94
- color: $color-sidenav-text-active;
95
- }
96
- }
97
- }
98
-
99
- @mixin vf-side-navigation-expandable-theme-light {
100
- @include vf-side-navigation-expandable-theme(
101
- $color-sidenav-text-active: $colors--light-theme--text-default,
102
- $color-sidenav-item-background-hover: $colors--light-theme--background-hover,
103
- $color-sidenav-toggle-icon: $colors--light-theme--text-inactive
104
- );
105
- }
106
-
107
- @mixin vf-side-navigation-expandable-theme-dark {
108
- @include vf-side-navigation-expandable-theme(
109
- $color-sidenav-text-active: $colors--dark-theme--text-default,
110
- $color-sidenav-item-background-hover: $colors--dark-theme--background-hover,
111
- // color of toggle icon - needed because of lack of rgba support in icon mixin
112
- $color-sidenav-toggle-icon: #999
113
- );
114
77
  }