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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-framework",
3
- "version": "4.7.0",
3
+ "version": "4.9.0",
4
4
  "author": {
5
5
  "email": "webteam@canonical.com",
6
6
  "name": "Canonical Webteam"
@@ -57,23 +57,23 @@
57
57
  "devDependencies": {
58
58
  "@canonical/cookie-policy": "3.5.0",
59
59
  "@canonical/latest-news": "1.5.0",
60
- "@percy/cli": "1.27.7",
60
+ "@percy/cli": "1.28.0",
61
61
  "@testing-library/cypress": "10.0.1",
62
62
  "autoprefixer": "10.4.17",
63
- "cypress": "13.6.4",
63
+ "cypress": "13.6.6",
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.33",
67
+ "postcss": "8.4.35",
68
68
  "postcss-cli": "11.0.0",
69
69
  "postcss-scss": "4.0.9",
70
- "prettier": "3.2.4",
71
- "sass": "1.70.0",
70
+ "prettier": "3.2.5",
71
+ "sass": "1.71.1",
72
72
  "stylelint": "16.2.1",
73
73
  "stylelint-config-recommended-scss": "14.0.0",
74
74
  "stylelint-order": "6.0.4",
75
75
  "stylelint-prettier": "5.0.0",
76
- "svgo": "2.8.0",
77
- "yaml": "2.3.4"
76
+ "svgo": "3.2.0",
77
+ "yaml": "2.4.0"
78
78
  }
79
79
  }
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
  }
@@ -100,15 +100,15 @@
100
100
  }
101
101
 
102
102
  @mixin vf-button-pattern(
103
- $button-background-color: $colors--light-theme--background-default,
104
- $button-text-color: $colors--light-theme--text-default,
103
+ $button-background-color: $colors--theme--background-default,
104
+ $button-text-color: $colors--theme--text-default,
105
105
  $button-disabled-background-color: $color-transparent,
106
- $button-disabled-border-color: $colors--light-theme--border-high-contrast,
107
- $button-border-color: $colors--light-theme--border-high-contrast,
108
- $button-hover-background-color: $colors--light-theme--background-hover,
109
- $button-hover-border-color: $colors--light-theme--border-high-contrast,
110
- $button-active-background-color: $colors--light-theme--background-active,
111
- $button-active-border-color: $colors--light-theme--border-high-contrast
106
+ $button-disabled-border-color: $colors--theme--border-high-contrast,
107
+ $button-border-color: $colors--theme--border-high-contrast,
108
+ $button-hover-background-color: $colors--theme--background-hover,
109
+ $button-hover-border-color: $colors--theme--border-high-contrast,
110
+ $button-active-background-color: $colors--theme--background-active,
111
+ $button-active-border-color: $colors--theme--border-high-contrast
112
112
  ) {
113
113
  background-color: $button-background-color;
114
114
  border-color: $button-border-color;
@@ -25,7 +25,7 @@ $code-inline-padding: 0.25rem;
25
25
  code,
26
26
  kbd,
27
27
  samp {
28
- background-color: $color-code-background;
28
+ background-color: $colors--theme--background-code;
29
29
  box-decoration-break: slice;
30
30
  color: inherit;
31
31
  line-height: map-get($line-heights, default-text) - $code-inline-padding;
@@ -59,8 +59,8 @@ $code-inline-padding: 0.25rem;
59
59
  }
60
60
 
61
61
  pre {
62
- background-color: $color-code-background;
63
- color: $colors--light-theme--text-default;
62
+ background-color: $colors--theme--background-code;
63
+ color: $colors--theme--text-default;
64
64
  display: block;
65
65
  margin-bottom: $spv--x-large;
66
66
  margin-top: 0;
@@ -81,7 +81,7 @@ $code-inline-padding: 0.25rem;
81
81
  %leading-linux-prompt-icon {
82
82
  &::before {
83
83
  @extend %icon;
84
- @include vf-icon-linux-prompt($color-mid-dark);
84
+ @include vf-icon-linux-prompt-themed;
85
85
 
86
86
  content: '';
87
87
  left: $sph--large;
@@ -110,7 +110,7 @@ $code-inline-padding: 0.25rem;
110
110
  }
111
111
 
112
112
  &::before {
113
- color: $color-mid-dark;
113
+ color: $colors--theme--text-muted;
114
114
  content: counter(line-numbering);
115
115
  counter-increment: line-numbering;
116
116
  height: 100%;
@@ -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,7 +183,7 @@
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;
@@ -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
- }
@@ -23,14 +23,14 @@
23
23
  @extend %fixed-width-container--common-properties;
24
24
 
25
25
  max-width: $grid-max-width;
26
- }
27
-
28
- %vf-row {
29
- @extend %fixed-width-container;
30
26
 
31
27
  & & {
32
28
  @include vf-b-row-reset;
33
29
  }
30
+ }
31
+
32
+ %vf-row {
33
+ @extend %fixed-width-container;
34
34
 
35
35
  @supports (display: grid) {
36
36
  display: grid;
@@ -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
- }