vanilla-framework 3.0.0 → 3.1.1

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.
package/package.json CHANGED
@@ -44,7 +44,7 @@
44
44
  "percy": "percy exec -- node snapshots.js",
45
45
  "icon-svgs-to-mixins": "node scripts/convert-svgs-to-icon-mixins.js icons"
46
46
  },
47
- "version": "3.0.0",
47
+ "version": "3.1.1",
48
48
  "files": [
49
49
  "_index.scss",
50
50
  "/scss",
@@ -52,12 +52,12 @@
52
52
  "!/scss/standalone"
53
53
  ],
54
54
  "dependencies": {
55
- "@canonical/cookie-policy": "3.3.0",
55
+ "@canonical/cookie-policy": "3.4.0",
56
56
  "@canonical/latest-news": "1.3.0",
57
- "autoprefixer": "10.4.1",
58
- "postcss": "8.4.5",
57
+ "autoprefixer": "10.4.2",
58
+ "postcss": "8.4.6",
59
59
  "postcss-cli": "9.1.0",
60
- "sass": "1.45.2"
60
+ "sass": "1.49.7"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@percy/script": "1.1.0",
@@ -65,7 +65,7 @@
65
65
  "markdown-spellcheck": "1.3.1",
66
66
  "parker": "0.0.10",
67
67
  "prettier": "2.5.1",
68
- "stylelint": "14.2.0",
68
+ "stylelint": "14.3.0",
69
69
  "stylelint-config-prettier": "9.0.3",
70
70
  "stylelint-config-recommended-scss": "5.0.2",
71
71
  "stylelint-order": "5.0.0",
@@ -1,10 +1,9 @@
1
1
  @mixin vf-b-range {
2
2
  $thumb-shadow: 0 0 $bar-thickness 1px rgba(0, 0, 0, 0.2);
3
- $thumb-size: 24px;
4
- $thumb-radius: $bar-thickness;
5
- $track-height: 5px;
6
- $track-border-size: 1px;
7
- $track-border: $track-border-size solid $colors--light-theme--border-high-contrast;
3
+ $thumb-size: 1rem;
4
+ $thumb-radius: 50%;
5
+ $thumb-border: 1px solid $color-mid-dark;
6
+ $track-height: $bar-thickness;
8
7
  $track-radius: $bar-thickness;
9
8
 
10
9
  // stylelint-disable selector-max-type -- base styles can use type selectors
@@ -14,16 +13,15 @@
14
13
  -moz-appearance: none;
15
14
  appearance: none;
16
15
  // stylelint-enable property-no-vendor-prefix
17
- border-radius: $track-radius + 1;
16
+ border-radius: $track-radius;
18
17
  margin: $sp-small 0;
19
18
  padding: 0;
20
19
  width: 100%;
21
20
 
22
21
  // Chrome
23
22
  &::-webkit-slider-runnable-track {
24
- border: $track-border;
25
- border-radius: $track-radius + 1;
26
- height: $track-height + 1;
23
+ border-radius: $track-radius;
24
+ height: $track-height;
27
25
  }
28
26
 
29
27
  &::-webkit-slider-thumb {
@@ -33,11 +31,11 @@
33
31
  appearance: none;
34
32
  // stylelint-enable property-no-vendor-prefix
35
33
  background: $color-x-light;
36
- border: 0;
34
+ border: $thumb-border;
37
35
  border-radius: $thumb-radius;
38
36
  box-shadow: $thumb-shadow;
39
37
  height: $thumb-size;
40
- margin-top: ((-$thumb-size + $track-height) * 0.5) - $track-border-size;
38
+ margin-top: (-$thumb-size + $track-height) * 0.5;
41
39
  width: $thumb-size;
42
40
 
43
41
  &:hover {
@@ -47,21 +45,20 @@
47
45
 
48
46
  // Firefox
49
47
  &::-moz-range-track {
50
- background: $color-x-light;
51
- border: $track-border;
48
+ background: $color-mid-light;
52
49
  border-radius: $track-radius;
53
- height: $track-height - 1;
50
+ height: $track-height;
54
51
  }
55
52
 
56
53
  &::-moz-range-progress {
57
- background-color: $color-information;
54
+ background-color: $color-link;
58
55
  border-radius: $track-radius;
59
- height: $track-height - 1;
56
+ height: $track-height;
60
57
  }
61
58
 
62
59
  &::-moz-range-thumb {
63
60
  background: $color-x-light;
64
- border: 0;
61
+ border: $thumb-border;
65
62
  border-radius: $thumb-radius;
66
63
  box-shadow: $thumb-shadow;
67
64
  height: $thumb-size;
@@ -29,6 +29,18 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
29
29
  }
30
30
  }
31
31
 
32
+ %nested-counter {
33
+ // Counter is named and it will be reset for each "ol" element.
34
+ counter-reset: list-item;
35
+ li::marker {
36
+ // "counters" function returns a string representing the current value of the named counter ("list-item").
37
+ // It is used to insert a string between different levels of nested counters.
38
+ // Source: https://www.w3schools.com/css/css_counters.asp
39
+ content: counters(list-item, '.') '. ';
40
+ counter-increment: list-item;
41
+ }
42
+ }
43
+
32
44
  // Mixin for list items
33
45
  %vf-list-item {
34
46
  padding-bottom: $spv--x-small;
@@ -395,6 +407,12 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
395
407
  }
396
408
  }
397
409
 
410
+ @mixin vf-p-list-nested-counter {
411
+ .p-list--nested-counter {
412
+ @extend %nested-counter;
413
+ }
414
+ }
415
+
398
416
  @mixin vf-p-lists {
399
417
  @include vf-p-list-placeholders;
400
418
 
@@ -407,4 +425,5 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
407
425
  @include vf-p-stepped-list;
408
426
  @include vf-p-stepped-list-detailed;
409
427
  @include vf-p-list-split;
428
+ @include vf-p-list-nested-counter;
410
429
  }
@@ -101,6 +101,8 @@ $notification-text-margin-bottom: $spv--large - $spv-nudge;
101
101
  background-repeat: no-repeat;
102
102
  background-size: unset;
103
103
  border: 0;
104
+ // set the height of the button to be size of an icon + padding on top and bottom
105
+ height: calc(2 * $spv--small + $default-icon-size);
104
106
  position: absolute;
105
107
  right: $sph--large * 0.5;
106
108
  top: $spv--small;
@@ -5,7 +5,8 @@
5
5
  @extend %vf-button-base;
6
6
  @include vf-button-pattern;
7
7
 
8
- &.is-active {
8
+ &.is-active,
9
+ &[aria-current='page'] {
9
10
  background-color: scale-color($color-x-light, $lightness: -$active-background-opacity-amount * 100%);
10
11
  color: $color-dark;
11
12
  text-decoration: none;
@@ -29,6 +29,7 @@
29
29
  .p-pull-quote__citation {
30
30
  @extend %vf-heading-6;
31
31
 
32
+ display: block;
32
33
  margin-top: $spv--small;
33
34
  }
34
35
  }
@@ -153,9 +153,11 @@
153
153
  border: 0;
154
154
  }
155
155
 
156
- // hide chips lead when there are in panel
157
- // FIXME: this should be handled in HTML/React, not CSS
158
156
  .p-chip {
157
+ margin-bottom: $spv--small;
158
+
159
+ // hide chips lead when there are in panel
160
+ // FIXME: this should be handled in HTML/React, not CSS
159
161
  .p-chip__lead {
160
162
  display: none;
161
163
  }
@@ -177,7 +179,7 @@
177
179
  position: relative;
178
180
 
179
181
  &[aria-expanded='false'] {
180
- max-height: 4rem;
182
+ max-height: 5rem; // 2 rows of chips
181
183
  }
182
184
  }
183
185
 
@@ -288,6 +288,8 @@
288
288
  li > strong,
289
289
  li > a {
290
290
  @extend %side-navigation__text;
291
+
292
+ display: block;
291
293
  }
292
294
 
293
295
  li li > span,
@@ -429,11 +431,11 @@
429
431
  border-color: $color-sidenav-list-border;
430
432
  }
431
433
 
432
- %theme-side-navigation__list {
434
+ .p-side-navigation__list::after {
433
435
  background: $color-sidenav-list-border;
434
436
  }
435
437
 
436
- %theme-side-navigation__link {
438
+ .p-side-navigation__link {
437
439
  &,
438
440
  &:visited {
439
441
  color: $color-sidenav-text-default;
@@ -460,14 +462,6 @@
460
462
  }
461
463
  }
462
464
 
463
- .p-side-navigation__list::after {
464
- @extend %theme-side-navigation__list;
465
- }
466
-
467
- .p-side-navigation__link {
468
- @extend %theme-side-navigation__link;
469
- }
470
-
471
465
  .p-side-navigation__item--title,
472
466
  .p-side-navigation__item--title .p-side-navigation__link {
473
467
  color: $color-sidenav-text-active;
@@ -1,8 +1,9 @@
1
1
  @import 'settings';
2
- $knob-size: $sp-unit * 3;
2
+ $knob-size: $sp-unit * 2;
3
3
 
4
4
  @mixin vf-p-switch {
5
5
  .p-switch {
6
+ align-items: center;
6
7
  display: flex;
7
8
  }
8
9
 
@@ -12,6 +13,7 @@ $knob-size: $sp-unit * 3;
12
13
  position: absolute;
13
14
 
14
15
  &:checked + .p-switch__slider::before {
16
+ border: 1px solid $color-link;
15
17
  left: 50%;
16
18
  }
17
19
 
@@ -19,6 +21,10 @@ $knob-size: $sp-unit * 3;
19
21
  @extend %vf-disabled-element;
20
22
  }
21
23
 
24
+ &:checked + .p-switch__slider {
25
+ background: $color-link;
26
+ }
27
+
22
28
  &:focus {
23
29
  outline: none;
24
30
 
@@ -29,9 +35,8 @@ $knob-size: $sp-unit * 3;
29
35
  }
30
36
 
31
37
  .p-switch__slider {
32
- @extend %vf-has-round-corners;
33
-
34
- background: linear-gradient(to right, $color-link 50%, $color-mid-light 50%);
38
+ background: $color-mid-light;
39
+ border-radius: $knob-size;
35
40
  box-shadow: inset 0 2px 5px 0 transparentize($color-dark, 0.8);
36
41
  display: inline-block;
37
42
  height: $knob-size;
@@ -45,6 +50,8 @@ $knob-size: $sp-unit * 3;
45
50
  @include vf-animation($duration: slow);
46
51
 
47
52
  background: $color-x-light;
53
+ border: 1px solid $color-mid-dark;
54
+ border-radius: 50%;
48
55
  content: '';
49
56
  height: $knob-size;
50
57
  left: 0;
@@ -27,16 +27,13 @@
27
27
  tr {
28
28
  border: $border;
29
29
  border-radius: $border-radius;
30
- display: grid;
31
- grid-gap: 0 map-get($grid-gutter-widths, small);
32
- grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
33
- grid-template-rows: auto;
30
+ display: block;
34
31
  margin-bottom: $spv--x-large;
35
32
  padding: 0 $sph--large;
36
33
  }
37
-
38
34
  td,
39
35
  tbody th {
36
+ display: block;
40
37
  min-width: 100%;
41
38
  overflow: hidden;
42
39
  padding-left: 0;