vanilla-framework 4.6.0 → 4.8.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 (37) hide show
  1. package/package.json +12 -13
  2. package/scss/_base.scss +2 -0
  3. package/scss/_base_background.scss +2 -6
  4. package/scss/_base_forms.scss +23 -104
  5. package/scss/_base_hr.scss +5 -39
  6. package/scss/_base_icon-definitions.scss +335 -46
  7. package/scss/_base_links.scss +2 -10
  8. package/scss/_base_placeholders.scss +1 -1
  9. package/scss/_base_tables.scss +2 -2
  10. package/scss/_base_themes.scss +52 -0
  11. package/scss/_base_typography-definitions.scss +1 -1
  12. package/scss/_global_functions.scss +10 -0
  13. package/scss/_layouts_application-panels.scss +1 -1
  14. package/scss/_patterns_chip.scss +156 -189
  15. package/scss/_patterns_contextual-menu.scss +16 -75
  16. package/scss/_patterns_divider.scss +5 -35
  17. package/scss/_patterns_form-help-text.scss +1 -29
  18. package/scss/_patterns_form-password-toggle.scss +1 -1
  19. package/scss/_patterns_form-tick-elements.scss +12 -129
  20. package/scss/_patterns_form-validation.scss +31 -229
  21. package/scss/_patterns_icons.scss +623 -442
  22. package/scss/_patterns_links.scss +12 -9
  23. package/scss/_patterns_lists.scss +0 -31
  24. package/scss/_patterns_navigation.scss +66 -13
  25. package/scss/_patterns_notifications.scss +21 -12
  26. package/scss/_patterns_search-box.scss +20 -99
  27. package/scss/_patterns_section.scss +12 -1
  28. package/scss/_patterns_side-navigation-expandable.scss +18 -55
  29. package/scss/_patterns_side-navigation.scss +117 -317
  30. package/scss/_patterns_strip.scss +87 -21
  31. package/scss/_patterns_suru.scss +126 -10
  32. package/scss/_patterns_table-mobile-card.scss +1 -1
  33. package/scss/_patterns_table-sortable.scss +2 -2
  34. package/scss/_patterns_tabs.scss +23 -74
  35. package/scss/_settings_colors.scss +164 -2
  36. package/scss/_settings_placeholders.scss +4 -1
  37. package/scss/_settings_themes.scss +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-framework",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "author": {
5
5
  "email": "webteam@canonical.com",
6
6
  "name": "Canonical Webteam"
@@ -57,23 +57,22 @@
57
57
  "devDependencies": {
58
58
  "@canonical/cookie-policy": "3.5.0",
59
59
  "@canonical/latest-news": "1.5.0",
60
- "@percy/cli": "1.27.6",
60
+ "@percy/cli": "1.27.7",
61
61
  "@testing-library/cypress": "10.0.1",
62
- "autoprefixer": "10.4.16",
63
- "cypress": "13.6.2",
62
+ "autoprefixer": "10.4.17",
63
+ "cypress": "13.6.4",
64
64
  "get-site-urls": "3.0.0",
65
65
  "markdown-spellcheck": "1.3.1",
66
66
  "parker": "0.0.10",
67
- "postcss": "8.4.32",
68
- "postcss-cli": "10.1.0",
67
+ "postcss": "8.4.33",
68
+ "postcss-cli": "11.0.0",
69
69
  "postcss-scss": "4.0.9",
70
- "prettier": "2.8.8",
71
- "sass": "1.69.6",
72
- "stylelint": "15.11.0",
73
- "stylelint-config-prettier": "9.0.5",
74
- "stylelint-config-recommended-scss": "5.0.2",
75
- "stylelint-order": "5.0.0",
76
- "stylelint-prettier": "2.0.0",
70
+ "prettier": "3.2.4",
71
+ "sass": "1.70.0",
72
+ "stylelint": "16.2.1",
73
+ "stylelint-config-recommended-scss": "14.0.0",
74
+ "stylelint-order": "6.0.4",
75
+ "stylelint-prettier": "5.0.0",
77
76
  "svgo": "2.8.0",
78
77
  "yaml": "2.3.4"
79
78
  }
package/scss/_base.scss CHANGED
@@ -1,6 +1,7 @@
1
1
  // Base
2
2
  @import 'base_placeholders'; //mandatory import
3
3
  @import 'base_icon-definitions';
4
+ @import 'base_themes';
4
5
  @import 'base_typography';
5
6
  @import 'base_blockquotes';
6
7
  @import 'base_box-sizing';
@@ -23,6 +24,7 @@
23
24
  @include vf-b-reset;
24
25
  // Base
25
26
  @include vf-b-placeholders; // mandatory include
27
+ @include vf-b-themes;
26
28
  @include vf-base-background;
27
29
  @include vf-b-typography;
28
30
  @include vf-b-blockquotes;
@@ -1,11 +1,7 @@
1
1
  @mixin vf-base-background {
2
2
  // stylelint-disable-next-line selector-max-type -- base styles can use type selectors
3
3
  body {
4
- background: $color-x-light;
5
- }
6
-
7
- // stylelint-disable-next-line selector-max-type -- base styles can use type selectors
8
- body.is-paper {
9
- background: $color-paper;
4
+ background: $colors--theme--background-default;
5
+ color: $colors--theme--text-default;
10
6
  }
11
7
  }
@@ -21,11 +21,11 @@
21
21
  -moz-appearance: textfield;
22
22
  appearance: textfield;
23
23
  // stylelint-enable property-no-vendor-prefix
24
- background-color: $colors--light-theme--background-inputs;
24
+ background-color: $colors--theme--background-inputs;
25
25
  border: 0 solid transparent;
26
- border-bottom: $input-border-thickness solid $colors--light-theme--text-default;
26
+ border-bottom: $input-border-thickness solid $colors--theme--border-high-contrast;
27
27
  border-radius: 0;
28
- color: $colors--light-theme--text-default;
28
+ color: $colors--theme--text-default;
29
29
  font-family: unquote($font-base-family);
30
30
  font-size: 1rem;
31
31
  font-weight: $font-weight-regular-text;
@@ -38,12 +38,28 @@
38
38
  width: 100%;
39
39
 
40
40
  &:hover {
41
- background-color: $colors--light-theme--background-hover;
41
+ background-color: $colors--theme--background-hover;
42
42
  }
43
43
 
44
44
  &:active,
45
45
  &:focus {
46
- background-color: $colors--light-theme--background-active;
46
+ background-color: $colors--theme--background-active;
47
+ }
48
+
49
+ // stylelint-disable-next-line selector-max-type -- base styles can use type selectors
50
+ option,
51
+ option:checked {
52
+ background-color: $colors--theme--background-alt;
53
+ color: $colors--theme--text-default;
54
+ }
55
+
56
+ // stylelint-disable-next-line selector-max-type -- base styles can use type selectors
57
+ option:checked:not(:disabled) {
58
+ background-color: $colors--theme--background-active;
59
+ }
60
+
61
+ &::placeholder {
62
+ color: $colors--theme--text-muted;
47
63
  }
48
64
 
49
65
  &.is-dense {
@@ -67,32 +83,6 @@
67
83
  border: $input-border-thickness solid $color;
68
84
  }
69
85
  }
70
-
71
- // Theming
72
- @if ($theme-default-forms == 'dark') {
73
- @include vf-input-dark-theme;
74
-
75
- &.is-light {
76
- @include vf-input-light-theme;
77
- }
78
-
79
- .is-paper &,
80
- &.is-paper {
81
- @include vf-input-paper-theme;
82
- }
83
- } @else {
84
- @include vf-input-light-theme;
85
-
86
- .is-dark &,
87
- &.is-dark {
88
- @include vf-input-dark-theme;
89
- }
90
-
91
- .is-paper &,
92
- &.is-paper {
93
- @include vf-input-paper-theme;
94
- }
95
- }
96
86
  }
97
87
 
98
88
  // Disabled form elements
@@ -193,14 +183,14 @@
193
183
 
194
184
  // Select styles
195
185
  select {
196
- @include vf-icon-chevron;
186
+ @include vf-icon-chevron-themed;
197
187
 
198
188
  // stylelint-disable property-no-vendor-prefix
199
189
  -moz-appearance: none;
200
190
  -webkit-appearance: none;
201
191
  appearance: none;
202
192
  // stylelint-enable property-no-vendor-prefix
203
- background-position: right $sph--small center;
193
+ background-position: right calc(map-get($grid-margin-widths, default) / 2) center;
204
194
  background-repeat: no-repeat;
205
195
  background-size: map-get($icon-sizes, default);
206
196
  box-shadow: none;
@@ -247,74 +237,3 @@
247
237
  }
248
238
  // stylelint-enable selector-max-type
249
239
  }
250
-
251
- @mixin vf-input-theme($color-background-default, $color-background-hover, $color-background-active, $color-background-option, $color-border, $color-text, $color-text-placeholder) {
252
- background-color: $color-background-default;
253
- border-color: $color-border;
254
- color: $color-text;
255
-
256
- &:hover {
257
- background-color: $color-background-hover;
258
- }
259
-
260
- &:active,
261
- &:focus {
262
- background-color: $color-background-active;
263
- }
264
-
265
- // stylelint-disable-next-line selector-max-type -- base styles can use type selectors
266
- option,
267
- option:checked {
268
- background-color: $color-background-option;
269
- color: $color-text;
270
- }
271
-
272
- // stylelint-disable-next-line selector-max-type -- base styles can use type selectors
273
- option:checked:not(:disabled) {
274
- background-color: $color-background-active;
275
- }
276
-
277
- &::placeholder {
278
- color: $color-text-placeholder;
279
- }
280
- }
281
-
282
- @mixin vf-input-light-theme {
283
- @include vf-input-theme(
284
- $color-background-default: $colors--light-theme--background-inputs,
285
- $color-background-hover: $colors--light-theme--background-hover,
286
- $color-background-active: $colors--light-theme--background-active,
287
- $color-background-option: $colors--light-theme--background-alt,
288
- $color-border: $colors--light-theme--text-default,
289
- $color-text: $colors--light-theme--text-default,
290
- $color-text-placeholder: $colors--light-theme--text-muted
291
- );
292
- }
293
-
294
- @mixin vf-input-paper-theme {
295
- // XXX: currently these colours are transparent,
296
- // so they work both on paper and white backgrounds.
297
- // We may need later to add a specific override for
298
- // a white background within paper themed pages.
299
- @include vf-input-theme(
300
- $color-background-default: $colors--paper-theme--background-inputs,
301
- $color-background-hover: $colors--paper-theme--background-hover,
302
- $color-background-active: $colors--paper-theme--background-active,
303
- $color-background-option: $colors--light-theme--background-alt,
304
- $color-border: $colors--light-theme--text-default,
305
- $color-text: $colors--light-theme--text-default,
306
- $color-text-placeholder: $colors--light-theme--text-muted
307
- );
308
- }
309
-
310
- @mixin vf-input-dark-theme {
311
- @include vf-input-theme(
312
- $color-background-default: $colors--dark-theme--background-inputs,
313
- $color-background-hover: $colors--dark-theme--background-hover,
314
- $color-background-active: $colors--dark-theme--background-active,
315
- $color-background-option: $colors--dark-theme--background-alt,
316
- $color-border: $colors--dark-theme--border-high-contrast,
317
- $color-text: $colors--dark-theme--text-default,
318
- $color-text-placeholder: $colors--dark-theme--text-muted
319
- );
320
- }
@@ -27,9 +27,14 @@
27
27
  // stylelint-disable selector-max-type -- base styles can use type selectors
28
28
  hr {
29
29
  @extend %hr;
30
+ background: $colors--theme--border-default;
30
31
 
31
32
  margin-bottom: calc($spv--small - 1px);
32
33
 
34
+ &.is-muted {
35
+ background-color: $colors--theme--border-low-contrast;
36
+ }
37
+
33
38
  &.u-no-margin--bottom {
34
39
  // compensate for hr thickness, to make sure it doesn't drift from baseline grid
35
40
  @extend %u-no-margin--bottom--hr;
@@ -39,44 +44,5 @@
39
44
  @extend %fixed-width-hr;
40
45
  }
41
46
  }
42
-
43
- // Theming
44
- @if ($theme-default-hr == 'dark') {
45
- hr {
46
- @include vf-hr-dark-theme;
47
- }
48
-
49
- hr.is-light {
50
- @include vf-hr-light-theme;
51
- }
52
- } @else {
53
- hr {
54
- @include vf-hr-light-theme;
55
- }
56
-
57
- hr.is-dark {
58
- @include vf-hr-dark-theme;
59
- }
60
- }
61
47
  // stylelint-enable selector-max-type
62
48
  }
63
-
64
- @mixin vf-hr-theme(
65
- // color of the horizontal rule line
66
- $color-hr-line-default,
67
- $color-hr-line-muted
68
- ) {
69
- background: $color-hr-line-default;
70
-
71
- &.is-muted {
72
- background-color: $color-hr-line-muted;
73
- }
74
- }
75
-
76
- @mixin vf-hr-light-theme {
77
- @include vf-hr-theme($color-hr-line-default: $colors--light-theme--border-default, $color-hr-line-muted: $colors--light-theme--border-low-contrast);
78
- }
79
-
80
- @mixin vf-hr-dark-theme {
81
- @include vf-hr-theme($color-hr-line-default: $colors--dark-theme--border-default, $color-hr-line-muted: $colors--dark-theme--border-low-contrast);
82
- }