vanilla-framework 3.8.2 → 3.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 (35) hide show
  1. package/package.json +8 -8
  2. package/scss/_base_button.scss +6 -7
  3. package/scss/_base_code.scss +3 -3
  4. package/scss/_base_forms-range.scss +1 -1
  5. package/scss/_base_forms.scss +25 -12
  6. package/scss/_base_hr.scss +7 -7
  7. package/scss/_base_placeholders.scss +2 -2
  8. package/scss/_layouts_fluid-breakout.scss +2 -2
  9. package/scss/_patterns_card.scss +1 -1
  10. package/scss/_patterns_chip.scss +3 -3
  11. package/scss/_patterns_contextual-menu.scss +2 -2
  12. package/scss/_patterns_form-tick-elements.scss +11 -7
  13. package/scss/_patterns_form-validation.scss +31 -4
  14. package/scss/_patterns_icons.scss +103 -103
  15. package/scss/_patterns_links.scss +1 -1
  16. package/scss/_patterns_lists.scss +4 -4
  17. package/scss/_patterns_logo-section.scss +4 -4
  18. package/scss/_patterns_matrix.scss +2 -2
  19. package/scss/_patterns_modal.scss +2 -2
  20. package/scss/_patterns_navigation.scss +5 -5
  21. package/scss/_patterns_notifications.scss +2 -2
  22. package/scss/_patterns_search-and-filter.scss +5 -4
  23. package/scss/_patterns_search-box.scss +9 -7
  24. package/scss/_patterns_segmented-control.scss +1 -1
  25. package/scss/_patterns_side-navigation.scss +1 -1
  26. package/scss/_patterns_strip.scss +2 -2
  27. package/scss/_patterns_switch.scss +2 -2
  28. package/scss/_patterns_table-sortable.scss +2 -2
  29. package/scss/_settings_colors.scss +16 -1
  30. package/scss/_settings_grid.scss +1 -1
  31. package/scss/_settings_placeholders.scss +2 -2
  32. package/scss/_settings_spacing.scss +1 -1
  33. package/scss/_utilities_font-metrics.scss +5 -5
  34. package/scss/_utilities_margin-collapse.scss +1 -1
  35. package/scss/_utilities_vertical-spacing.scss +1 -1
package/package.json CHANGED
@@ -47,7 +47,7 @@
47
47
  "percy": "percy exec -- node snapshots.js",
48
48
  "icon-svgs-to-mixins": "node scripts/convert-svgs-to-icon-mixins.js icons"
49
49
  },
50
- "version": "3.8.2",
50
+ "version": "3.9.0",
51
51
  "files": [
52
52
  "_index.scss",
53
53
  "/scss",
@@ -58,22 +58,22 @@
58
58
  "@canonical/cookie-policy": "3.4.0",
59
59
  "@canonical/latest-news": "1.4.1",
60
60
  "autoprefixer": "10.4.13",
61
- "postcss": "8.4.18",
61
+ "postcss": "8.4.19",
62
62
  "postcss-cli": "9.1.0",
63
- "postcss-scss": "4.0.5",
64
- "sass": "1.56.0",
63
+ "postcss-scss": "4.0.6",
64
+ "sass": "1.56.1",
65
65
  "yaml": "1.10.2"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@percy/script": "1.1.0",
69
- "@testing-library/cypress": "8.0.3",
69
+ "@testing-library/cypress": "8.0.7",
70
70
  "cypress": "10.11.0",
71
71
  "get-site-urls": "3.0.0",
72
72
  "markdown-spellcheck": "1.3.1",
73
73
  "parker": "0.0.10",
74
- "prettier": "2.7.1",
75
- "stylelint": "14.14.1",
76
- "stylelint-config-prettier": "9.0.3",
74
+ "prettier": "2.8.0",
75
+ "stylelint": "14.16.0",
76
+ "stylelint-config-prettier": "9.0.4",
77
77
  "stylelint-config-recommended-scss": "5.0.2",
78
78
  "stylelint-order": "5.0.0",
79
79
  "stylelint-prettier": "2.0.0",
@@ -9,17 +9,16 @@
9
9
  }
10
10
 
11
11
  %vf-button-dense-vertical-padding {
12
- padding-bottom: calc(#{$spv-nudge - $sp-unit * 0.5} - 1px);
13
- padding-top: calc(#{$spv-nudge - $sp-unit * 0.5} - 1px);
12
+ padding-bottom: calc($spv-nudge - $sp-unit * 0.5 - $input-border-thickness);
13
+ padding-top: calc($spv-nudge - $sp-unit * 0.5 - $input-border-thickness);
14
14
  }
15
15
 
16
16
  %vf-button-base {
17
17
  @include vf-transition(#{background-color, border-color}, snap, in);
18
18
  @include vf-focus;
19
19
 
20
- border-radius: $border-radius;
21
20
  border-style: solid;
22
- border-width: 1px;
21
+ border-width: $input-border-thickness;
23
22
  cursor: pointer;
24
23
  display: inline-block;
25
24
  font-size: 1rem;
@@ -57,13 +56,13 @@
57
56
  font-size: #{map-get($font-sizes, small)}rem;
58
57
  line-height: map-get($line-heights, small);
59
58
  margin-bottom: $input-margin-bottom - $sp-unit;
60
- padding: calc(#{map-get($nudges, small)} - 1px) $sph--small;
59
+ padding: calc(map-get($nudges, small) - $input-border-thickness) $sph--small;
61
60
  }
62
61
 
63
62
  &.is-small.is-dense {
64
63
  margin-bottom: $spv-nudge-compensation;
65
- padding-bottom: calc(#{$spv-nudge - $sp-unit * 0.5} - 1px);
66
- padding-top: calc(#{$spv-nudge - $sp-unit * 0.5} - 1px);
64
+ padding-bottom: calc($spv-nudge - $sp-unit * 0.5 - $input-border-thickness);
65
+ padding-top: calc($spv-nudge - $sp-unit * 0.5 - $input-border-thickness);
67
66
  }
68
67
 
69
68
  // The following rules address buttons nested in <p>'s;
@@ -2,7 +2,7 @@
2
2
 
3
3
  $color-pre-bg: rgba($color-x-dark, 0.03);
4
4
  $digit-width: 1ch; // measured width of one character in the monospaced font
5
- $code-sidebar-width: calc(#{$sph--large} + (4 * #{$digit-width})) !default;
5
+ $code-sidebar-width: calc($sph--large + (4 * $digit-width)) !default;
6
6
  $code-inline-padding: 0.25rem;
7
7
 
8
8
  // Base code styles
@@ -30,7 +30,7 @@ $code-inline-padding: 0.25rem;
30
30
  box-decoration-break: slice;
31
31
  color: inherit;
32
32
  line-height: map-get($line-heights, default-text) - $code-inline-padding;
33
- padding: calc(#{$code-inline-padding} - 1px) $code-inline-padding;
33
+ padding: calc($code-inline-padding - $input-border-thickness) $code-inline-padding;
34
34
  }
35
35
 
36
36
  code,
@@ -124,7 +124,7 @@ $code-inline-padding: 0.25rem;
124
124
  user-select: none;
125
125
  // We're adding a negative left position above of $digit-width,
126
126
  // so the width here needs to take that into account
127
- width: calc(#{$code-sidebar-width} + #{$digit-width});
127
+ width: calc($code-sidebar-width + $digit-width);
128
128
  }
129
129
  }
130
130
  }
@@ -2,7 +2,7 @@
2
2
  $thumb-shadow: 0 0 $bar-thickness 1px rgba(0, 0, 0, 0.2);
3
3
  $thumb-size: 1rem;
4
4
  $thumb-radius: 50%;
5
- $thumb-border: 1px solid $color-mid-dark;
5
+ $thumb-border: $input-border-thickness solid $color-mid-dark;
6
6
  $track-height: $bar-thickness;
7
7
  $track-radius: $bar-thickness;
8
8
 
@@ -4,7 +4,6 @@
4
4
  // Form element styles
5
5
  @mixin vf-b-forms {
6
6
  @include vf-b-range;
7
-
8
7
  // Used in buttons, inputs
9
8
  %bordered-text-vertical-padding {
10
9
  padding-bottom: $input-vertical-padding;
@@ -15,17 +14,17 @@
15
14
  %vf-input-elements {
16
15
  @extend %bordered-text-vertical-padding;
17
16
  @include vf-focus($color-focus, $bar-thickness, true);
17
+ @include vf-animation(#{background-color}, fast);
18
18
 
19
19
  // stylelint-disable property-no-vendor-prefix
20
20
  -webkit-appearance: textfield;
21
21
  -moz-appearance: textfield;
22
22
  appearance: textfield;
23
23
  // stylelint-enable property-no-vendor-prefix
24
-
25
- background-color: $color-x-light;
26
- border: 1px solid $colors--light-theme--border-high-contrast;
24
+ background-color: $colors--light-theme--background-inputs;
25
+ border: 0 solid transparent;
26
+ border-bottom: $input-border-thickness solid $colors--light-theme--text-default;
27
27
  border-radius: 0;
28
- box-shadow: inset 0 1px 1px $color-input-shadow;
29
28
  color: $color-dark;
30
29
  font-family: unquote($font-base-family);
31
30
  font-size: 1rem;
@@ -38,10 +37,19 @@
38
37
  vertical-align: baseline;
39
38
  width: 100%;
40
39
 
40
+ &:hover {
41
+ background-color: $colors--light-theme--background-hover;
42
+ }
43
+
44
+ &:active,
45
+ &:focus {
46
+ background-color: $colors--light-theme--background-active;
47
+ }
48
+
41
49
  &.is-dense {
42
50
  margin: 0 0 $spv-nudge-compensation 0;
43
- padding-bottom: calc(#{$spv-nudge - $spv--x-small} - 1px);
44
- padding-top: calc(#{$spv-nudge - $spv--x-small} - 1px);
51
+ padding-bottom: calc($spv-nudge - $spv--x-small - $input-border-thickness);
52
+ padding-top: calc($spv-nudge - $spv--x-small - $input-border-thickness);
45
53
  }
46
54
 
47
55
  &[disabled],
@@ -56,7 +64,7 @@
56
64
 
57
65
  @each $state, $color in $states {
58
66
  &.has-#{$state} {
59
- border: 1px solid $color;
67
+ border: $input-border-thickness solid $color;
60
68
  }
61
69
  }
62
70
  }
@@ -166,14 +174,14 @@
166
174
  -webkit-appearance: none;
167
175
  appearance: none;
168
176
  // stylelint-enable property-no-vendor-prefix
169
- background-color: $color-x-light;
177
+ background-color: $colors--light-theme--background-hover;
170
178
  background-position: right $sph--small center;
171
179
  background-repeat: no-repeat;
172
180
  background-size: map-get($icon-sizes, default);
173
181
  box-shadow: none;
174
182
  color: $color-dark;
175
183
  min-height: map-get($line-heights, default-text);
176
- padding-right: calc(#{$default-icon-size} + #{2 * $sph--small});
184
+ padding-right: calc($default-icon-size + 2 * $sph--small);
177
185
  text-indent: 0.01px;
178
186
  text-overflow: '';
179
187
 
@@ -181,6 +189,10 @@
181
189
  cursor: pointer;
182
190
  }
183
191
 
192
+ option {
193
+ background-color: white;
194
+ }
195
+
184
196
  &[multiple],
185
197
  &[size] {
186
198
  background-image: none;
@@ -188,8 +200,9 @@
188
200
  height: auto;
189
201
 
190
202
  option {
203
+ background-color: $colors--light-theme--background-hover;
191
204
  font-weight: $font-weight-regular-text;
192
- line-height: calc(#{$sp-unit * 2} - 2px);
205
+ line-height: calc($sp-unit * 2 - 2px);
193
206
  padding: $spv--x-small 0;
194
207
  }
195
208
  }
@@ -212,7 +225,7 @@
212
225
 
213
226
  margin-left: 0;
214
227
  margin-right: 0;
215
- padding: calc(#{$spv--large} - 1px);
228
+ padding: calc($spv--large - $input-border-thickness);
216
229
  }
217
230
  // stylelint-enable selector-max-type
218
231
  }
@@ -6,7 +6,7 @@
6
6
  hr {
7
7
  @extend %hr;
8
8
 
9
- margin-bottom: calc(#{$spv--small} - 1px);
9
+ margin-bottom: calc($spv--small - $input-border-thickness);
10
10
 
11
11
  &.u-no-margin--bottom {
12
12
  // compensate for hr thickness, to make sure it doesn't drift from baseline grid
@@ -20,17 +20,17 @@
20
20
  &.is-fixed-width {
21
21
  margin-left: auto;
22
22
  margin-right: auto;
23
- max-width: calc(#{$grid-max-width} - #{2 * map-get($grid-margin-widths, small)});
24
- width: calc(100% - #{2 * map-get($grid-margin-widths, small)});
23
+ max-width: calc($grid-max-width - 2 * map-get($grid-margin-widths, small));
24
+ width: calc(100% - 2 * map-get($grid-margin-widths, small));
25
25
 
26
26
  @media (min-width: $threshold-4-6-col) {
27
- max-width: calc(#{$grid-max-width} - #{2 * map-get($grid-margin-widths, default)});
28
- width: calc(100% - #{2 * map-get($grid-margin-widths, default)});
27
+ max-width: calc($grid-max-width - 2 * map-get($grid-margin-widths, default));
28
+ width: calc(100% - 2 * map-get($grid-margin-widths, default));
29
29
  }
30
30
 
31
31
  @media (min-width: $threshold-6-12-col) {
32
- max-width: calc(#{$grid-max-width} - #{2 * map-get($grid-margin-widths, default)});
33
- width: calc(100% - #{2 * map-get($grid-margin-widths, default)});
32
+ max-width: calc($grid-max-width - 2 * map-get($grid-margin-widths, default));
33
+ width: calc(100% - 2 * map-get($grid-margin-widths, default));
34
34
  }
35
35
 
36
36
  .row &,
@@ -50,7 +50,7 @@
50
50
  //accordion, table
51
51
  %single-border-text-vpadding--scaling {
52
52
  padding-bottom: $table-cell-vertical-padding;
53
- padding-top: calc(#{$table-cell-vertical-padding} - 1px);
53
+ padding-top: calc($table-cell-vertical-padding - 1px);
54
54
  }
55
55
 
56
56
  // Default list styling
@@ -223,7 +223,7 @@
223
223
  margin: 0;
224
224
  padding: 0;
225
225
  position: relative;
226
- vertical-align: calc(#{$vertical-offset} + #{0.5 * $cap-height} - #{0.5 * $default-icon-size});
226
+ vertical-align: calc($vertical-offset + 0.5 * $cap-height - 0.5 * $default-icon-size);
227
227
  }
228
228
 
229
229
  %social-icon {
@@ -21,7 +21,7 @@
21
21
  grid-template-rows: auto;
22
22
  margin-left: auto;
23
23
  margin-right: auto;
24
- max-width: calc(2 * #{$l-fluid-breakout-aside-width} + #{$l-fluid-breakout-max-width});
24
+ max-width: calc(2 * $l-fluid-breakout-aside-width + $l-fluid-breakout-max-width);
25
25
  }
26
26
 
27
27
  @media (min-width: $threshold-4-6-col) {
@@ -135,7 +135,7 @@
135
135
  grid-template-rows: auto;
136
136
  margin-left: auto;
137
137
  margin-right: auto;
138
- max-width: calc(2 * #{$l-fluid-breakout-aside-width} + #{$l-fluid-breakout-max-width});
138
+ max-width: calc(2 * $l-fluid-breakout-aside-width + $l-fluid-breakout-max-width);
139
139
  }
140
140
 
141
141
  @media (min-width: $l-fluid-breakout-3-col-threshold) {
@@ -14,7 +14,7 @@
14
14
  @extend %vf-is-bordered;
15
15
  @extend %vf-has-round-corners;
16
16
 
17
- padding: calc(#{$spv--large} - 1px);
17
+ padding: calc($spv--large - 1px);
18
18
  }
19
19
  }
20
20
 
@@ -12,10 +12,10 @@
12
12
  display: inline-flex;
13
13
  margin: 0 $sph--small $input-margin-bottom 0;
14
14
  max-width: 100%;
15
- padding: calc(#{$spv--x-small} - 1px) $sph--small; // account for border thickness using calc
15
+ padding: calc($spv--x-small - $input-border-thickness) $sph--small; // account for border thickness using calc
16
16
  position: relative;
17
17
  user-select: none;
18
- vertical-align: calc(1px - #{map-get($nudges, p)});
18
+ vertical-align: calc($input-border-thickness - map-get($nudges, p));
19
19
  white-space: nowrap;
20
20
 
21
21
  .p-chip__lead,
@@ -242,7 +242,7 @@
242
242
  $color-border: map-get($colors-chip-tinted-borders, $chip-type);
243
243
 
244
244
  background-color: $color-background;
245
- border: 1px solid $color-border;
245
+ border: $input-border-thickness solid $color-border;
246
246
 
247
247
  .p-chip__value {
248
248
  color: $color-chip-value;
@@ -59,8 +59,8 @@
59
59
 
60
60
  + .p-contextual-menu__group {
61
61
  border-top-style: solid;
62
- border-top-width: 1px;
63
- margin: -1px 0 0 0;
62
+ border-top-width: $input-border-thickness;
63
+ margin: -$input-border-thickness 0 0 0;
64
64
  }
65
65
  }
66
66
 
@@ -27,8 +27,8 @@
27
27
  content: '';
28
28
  height: $form-tick-box-size;
29
29
  left: 0;
30
- outline-offset: 1px;
31
- top: calc(#{$baseline-position} - #{$form-tick-box-size} + #{$form-tick-box-nudge});
30
+ outline-offset: $input-border-thickness;
31
+ top: calc($baseline-position - $form-tick-box-size + $form-tick-box-nudge);
32
32
  width: $form-tick-box-size;
33
33
  }
34
34
 
@@ -41,6 +41,10 @@
41
41
  .p-muted-heading & {
42
42
  color: $colors--light-theme--text-muted;
43
43
  }
44
+
45
+ &:hover::before {
46
+ background-color: $colors--light-theme--background-hover;
47
+ }
44
48
  }
45
49
 
46
50
  %vf-pseudo-tick-box-checked {
@@ -63,7 +67,7 @@
63
67
  %vf-pseudo-checkbox {
64
68
  // container
65
69
  &::before {
66
- border-radius: $border-radius;
70
+ border-radius: 0;
67
71
  }
68
72
 
69
73
  //tick
@@ -72,7 +76,7 @@
72
76
  border-left: 2px solid;
73
77
  height: $form-tick-height;
74
78
  left: $form-tick-height * 0.5;
75
- top: calc(#{$baseline-position} - #{$form-tick-box-size} + #{$form-tick-offset-top} + #{$form-tick-box-nudge});
79
+ top: calc($baseline-position - $form-tick-box-size + $form-tick-offset-top + $form-tick-box-nudge);
76
80
  transform: rotate(-45deg);
77
81
  width: 0.625rem;
78
82
  }
@@ -97,7 +101,7 @@
97
101
  border-radius: 50%;
98
102
  height: $form-radio-inner-circle-diameter;
99
103
  left: #{($form-tick-box-size - $form-radio-inner-circle-diameter) * 0.5};
100
- top: calc(#{$baseline-position} - #{$form-tick-box-size} + #{$form-radio-circle-offset} + #{$form-tick-box-nudge});
104
+ top: calc($baseline-position - $form-tick-box-size + $form-radio-circle-offset + $form-tick-box-nudge);
101
105
  width: $form-radio-inner-circle-diameter;
102
106
  }
103
107
  }
@@ -141,7 +145,7 @@
141
145
  }
142
146
  .p-radio__label,
143
147
  .p-checkbox__label {
144
- padding-left: calc(#{$sph--large + $form-tick-box-size} + #{$asterisk-width});
148
+ padding-left: calc($sph--large + $form-tick-box-size + $asterisk-width);
145
149
  }
146
150
  }
147
151
  }
@@ -252,7 +256,7 @@
252
256
 
253
257
  &::before {
254
258
  background: $color-tick-background;
255
- border: 1px solid $color-tick-border;
259
+ border: $input-border-thickness solid $color-tick-border;
256
260
  }
257
261
  }
258
262
 
@@ -7,7 +7,7 @@
7
7
  %vf-validation-wrapper {
8
8
  background-position: left, center;
9
9
  background-repeat: no-repeat;
10
- padding-left: calc(#{$icon-size} + #{$sph--small});
10
+ padding-left: calc($icon-size + $sph--small);
11
11
  padding-top: 0;
12
12
  }
13
13
 
@@ -19,7 +19,16 @@
19
19
 
20
20
  .is-success {
21
21
  .p-form-validation__input {
22
- border-color: $color-positive;
22
+ background-color: $color-positive-background;
23
+ border-bottom-color: $color-positive;
24
+
25
+ &:hover {
26
+ background-color: $color-positive-background--hover;
27
+ }
28
+
29
+ &:focus {
30
+ background-color: $color-positive-background--focus;
31
+ }
23
32
  }
24
33
 
25
34
  .p-form-validation__message {
@@ -32,7 +41,16 @@
32
41
 
33
42
  .is-caution {
34
43
  .p-form-validation__input {
35
- border-color: $color-caution;
44
+ background-color: $color-caution-background;
45
+ border-bottom-color: $color-caution;
46
+
47
+ &:hover {
48
+ background-color: $color-caution-background--hover;
49
+ }
50
+
51
+ &:focus {
52
+ background-color: $color-caution-background--focus;
53
+ }
36
54
  }
37
55
 
38
56
  .p-form-validation__message {
@@ -43,7 +61,16 @@
43
61
 
44
62
  .is-error {
45
63
  .p-form-validation__input {
46
- border-color: $color-negative;
64
+ background-color: $color-negative-background;
65
+ border-bottom-color: $color-negative;
66
+
67
+ &:hover {
68
+ background-color: $color-negative-background--hover;
69
+ }
70
+
71
+ &:focus {
72
+ background-color: $color-negative-background--focus;
73
+ }
47
74
  }
48
75
 
49
76
  .p-form-validation__message {