vanilla-framework 4.6.0 → 4.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-framework",
3
- "version": "4.6.0",
3
+ "version": "4.7.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
  }
@@ -200,7 +200,7 @@
200
200
  -webkit-appearance: none;
201
201
  appearance: none;
202
202
  // stylelint-enable property-no-vendor-prefix
203
- background-position: right $sph--small center;
203
+ background-position: right calc(map-get($grid-margin-widths, default) / 2) center;
204
204
  background-repeat: no-repeat;
205
205
  background-size: map-get($icon-sizes, default);
206
206
  box-shadow: none;
@@ -16,7 +16,9 @@
16
16
 
17
17
  &::before,
18
18
  &::after {
19
- $properties: #{background-color, border-color};
19
+ $properties:
20
+ #{background-color,
21
+ border-color};
20
22
  @include vf-transition($properties);
21
23
 
22
24
  position: absolute;
@@ -7,6 +7,7 @@ $navigation-logo-tag-height-desktop: 2.3rem;
7
7
  $navigation-logo-banner-height: 3rem; // legacy logo height (small and medium screens)
8
8
  $navigation-logo-banner-height-desktop: 3.5rem; // legacy logo height (on large screens)
9
9
  $navigation-logo-size: 1rem;
10
+ $navigation-logo-padding: calc(1.5rem + 0.19rem); // ~27px to align better with logos as originally designed in SVG
10
11
  $sph-navigation-link: 0.3rem;
11
12
  $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
12
13
 
@@ -31,7 +32,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
31
32
  }
32
33
 
33
34
  @media (min-width: $breakpoint-navigation-threshold) {
34
- padding-left: $sph--large;
35
+ padding-left: map-get($grid-margin-widths, default);
35
36
  }
36
37
  }
37
38
 
@@ -44,7 +45,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
44
45
  }
45
46
 
46
47
  @media (min-width: $breakpoint-navigation-threshold) {
47
- padding-right: $sph--large;
48
+ padding-right: map-get($grid-margin-widths, default);
48
49
  }
49
50
  }
50
51
 
@@ -54,7 +55,10 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
54
55
  }
55
56
 
56
57
  %navigation-link {
57
- $properties: #{background-color, color, opacity};
58
+ $properties:
59
+ #{background-color,
60
+ color,
61
+ opacity};
58
62
  @extend %navigation-link-responsive-padding-horizontal;
59
63
  @extend %navigation-link-responsive-padding-vertical;
60
64
  @extend %vf-navigation-separator;
@@ -71,7 +75,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
71
75
  line-height: map-get($line-heights, default-text);
72
76
  margin: 0;
73
77
  overflow: hidden;
74
- padding-left: calc(#{map-get($grid-margin-widths, small)} + #{$sph--x-large}); // allow navigation align with tag logo text on small screens
78
+ padding-left: calc(map-get($grid-margin-widths, small) + $navigation-logo-padding); // allow navigation align with tag logo text on small screens
75
79
  position: relative;
76
80
  text-align: left;
77
81
  text-overflow: ellipsis;
@@ -79,11 +83,11 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
79
83
  width: 100%;
80
84
 
81
85
  @media (min-width: $threshold-4-6-col) {
82
- padding-left: calc(#{map-get($grid-margin-widths, default)} + #{$sph--x-large});
86
+ padding-left: calc(map-get($grid-margin-widths, default) + $navigation-logo-padding);
83
87
  }
84
88
 
85
89
  @media (min-width: $breakpoint-navigation-threshold) {
86
- padding-left: $sph--large;
90
+ padding-left: map-get($grid-margin-widths, default);
87
91
  }
88
92
 
89
93
  &:visited,
@@ -185,6 +189,52 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
185
189
  width: 100%;
186
190
  }
187
191
 
192
+ .p-navigation__row--25-75 {
193
+ // ideally we'd like to extend row only on large screens,
194
+ // but that's not possible to use @extend inside media query
195
+ @extend %vf-row;
196
+
197
+ // when mobile navigation is displayed, remove default row padding
198
+ @media (width < $breakpoint-navigation-threshold) {
199
+ padding: 0;
200
+ }
201
+
202
+ // when large screen navigation is displayed, use 25/75 grid split
203
+ @media (min-width: $breakpoint-navigation-threshold) {
204
+ // remove padding from logo banner (the grid has its own padding)
205
+ .p-navigation__banner {
206
+ padding-left: 0;
207
+ }
208
+
209
+ // shift navigation items by the size of grid margin to align with grid
210
+ .p-navigation__items:first-child {
211
+ margin-left: calc(-1 * map-get($grid-margin-widths, default));
212
+ }
213
+
214
+ // on medium screen sizes (6 columns) use 2/4 column split
215
+ @media (min-width: $threshold-4-6-col) {
216
+ > .p-navigation__banner {
217
+ grid-column-end: span 2;
218
+ }
219
+
220
+ > .p-navigation__nav {
221
+ grid-column-end: span 4;
222
+ }
223
+ }
224
+
225
+ // on large screen sizes (12 columns) use 3/9 column split
226
+ @media (min-width: $threshold-6-12-col) {
227
+ > .p-navigation__banner {
228
+ grid-column-end: span 3;
229
+ }
230
+
231
+ > .p-navigation__nav {
232
+ grid-column-end: span 9;
233
+ }
234
+ }
235
+ }
236
+ }
237
+
188
238
  .p-navigation__item,
189
239
  .p-navigation__item--dropdown-toggle {
190
240
  @media (min-width: $breakpoint-navigation-threshold) {
@@ -282,7 +332,9 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
282
332
  .p-navigation__link {
283
333
  @extend %navigation-link;
284
334
 
285
- padding-left: calc($sph--x-large + 0.19rem); // additional padding added to align better with logos as originally designed in SVG
335
+ // within logo we don't need a regular item padding
336
+ @extend %vf-reset-horizontal-padding;
337
+ padding-left: $navigation-logo-padding;
286
338
 
287
339
  &:hover {
288
340
  background-color: transparent !important;
@@ -430,8 +482,9 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
430
482
 
431
483
  display: block;
432
484
  height: 100%; // keep the height of the navigation when 'Search' label is hidden
485
+
433
486
  padding-left: 0; // on small screens label is hidden, so we remove left padding as well
434
- padding-right: 2 * $sph--small + map-get($icon-sizes, default);
487
+ padding-right: calc(map-get($grid-margin-widths, default) + map-get($icon-sizes, default));
435
488
  position: relative;
436
489
 
437
490
  // hide "search" label on small screens (only show the icon)
@@ -441,7 +494,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
441
494
 
442
495
  // show both label and icon on large screens
443
496
  @media (min-width: $breakpoint-large) {
444
- padding-left: $sph--large;
497
+ padding-left: map-get($grid-margin-widths, default);
445
498
 
446
499
  .p-navigation__search-label {
447
500
  display: initial;
@@ -457,7 +510,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
457
510
  height: $spv--large;
458
511
  pointer-events: none;
459
512
  position: absolute;
460
- right: calc($sph--small + 1px); // 1px for the border on selects. this aligns it with any selects underneath
513
+ right: calc(map-get($grid-margin-widths, default) / 2);
461
514
  text-indent: calc(100% + 10rem);
462
515
  top: calc($spv--medium + map-get($nudges, x-small));
463
516
  width: map-get($icon-sizes, default);
@@ -597,7 +650,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
597
650
  }
598
651
 
599
652
  @media (min-width: $breakpoint-navigation-threshold) {
600
- right: calc($sph--small + 1px); // 1px for the border on selects. this aligns it with any selects underneath
653
+ right: calc(map-get($grid-margin-widths, default) / 2); // position by the center of grid margin
601
654
  top: calc($spv--large + map-get($nudges, x-small));
602
655
  transform: rotate(0deg);
603
656
  }
@@ -619,8 +672,8 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
619
672
  }
620
673
 
621
674
  .p-navigation__link {
622
- // add padding to accommodate icon
623
- padding-right: 2 * $sph--small + map-get($icon-sizes, default);
675
+ // increase padding to accommodate chevron icon
676
+ padding-right: map-get($grid-margin-widths, default) + map-get($icon-sizes, default);
624
677
  }
625
678
 
626
679
  &:first-child .p-navigation__link::before {
@@ -116,9 +116,19 @@ $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
116
116
  linear-gradient(to top right, #fff 0%, #fff 49%, transparent 50%, transparent 100%), linear-gradient(to top right, #fff 0%, #fff 100%),
117
117
  linear-gradient(111deg, $color-suru-start 10%, $color-suru-middle 37%, $color-suru-end 100%);
118
118
 
119
- background-position: 0% 0%, top right, right 0 bottom 4rem, right bottom, 0% 0%;
119
+ background-position:
120
+ 0% 0%,
121
+ top right,
122
+ right 0 bottom 4rem,
123
+ right bottom,
124
+ 0% 0%;
120
125
  background-repeat: no-repeat;
121
- background-size: 100% calc(100% - 4rem), 50% 100%, 100% 4rem, 100% 4rem, auto;
126
+ background-size:
127
+ 100% calc(100% - 4rem),
128
+ 50% 100%,
129
+ 100% 4rem,
130
+ 100% 4rem,
131
+ auto;
122
132
  color: $color-x-light;
123
133
  margin-bottom: -4rem;
124
134
  overflow: hidden;
@@ -136,16 +146,36 @@ $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
136
146
  &.is-deep {
137
147
  $padding: 3rem;
138
148
 
139
- background-position: 0% 0%, top right, right 0 bottom $padding, right bottom, 0% 0%;
140
- background-size: 100% calc(100% - $padding), 100% 100%, 100% $padding, 100% $padding, auto;
149
+ background-position:
150
+ 0% 0%,
151
+ top right,
152
+ right 0 bottom $padding,
153
+ right bottom,
154
+ 0% 0%;
155
+ background-size:
156
+ 100% calc(100% - $padding),
157
+ 100% 100%,
158
+ 100% $padding,
159
+ 100% $padding,
160
+ auto;
141
161
  margin-bottom: -$padding;
142
162
  padding-bottom: ($padding * 3) !important;
143
163
 
144
164
  @media (min-width: $threshold-6-12-col) {
145
165
  $padding: 6rem;
146
166
 
147
- background-position: 0% 0%, top right, right 0 bottom $padding, right bottom, 0% 0%;
148
- background-size: 100% calc(100% - $padding), 50% 100%, 100% $padding, 100% $padding, auto;
167
+ background-position:
168
+ 0% 0%,
169
+ top right,
170
+ right 0 bottom $padding,
171
+ right bottom,
172
+ 0% 0%;
173
+ background-size:
174
+ 100% calc(100% - $padding),
175
+ 50% 100%,
176
+ 100% $padding,
177
+ 100% $padding,
178
+ auto;
149
179
  margin-bottom: -$padding;
150
180
  padding-bottom: ($padding * 3) !important;
151
181
  }
@@ -167,9 +197,17 @@ $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
167
197
  linear-gradient(to bottom right, transparent 0%, transparent 49%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 1) 100%),
168
198
  linear-gradient(90deg, $color-suru-start 4%, $color-suru-middle 50%, $color-suru-end 88%);
169
199
 
170
- background-position: top right, top right, top left, top left;
200
+ background-position:
201
+ top right,
202
+ top right,
203
+ top left,
204
+ top left;
171
205
  background-repeat: no-repeat;
172
- background-size: 39.4% 6rem, 54% 4rem, 63% 4rem, 62.6% 4rem;
206
+ background-size:
207
+ 39.4% 6rem,
208
+ 54% 4rem,
209
+ 63% 4rem,
210
+ 62.6% 4rem;
173
211
  padding-bottom: 4rem;
174
212
  padding-top: 6rem;
175
213
 
@@ -6,5 +6,8 @@ $input-border-thickness: 1.5px;
6
6
  $bar-thickness: 0.1875rem !default; // 3px at 16px fontsize, expressed in rems so it scales with text if the root font-size changes at a breakpoint
7
7
  $border-radius: 0; // deprecated, will be removed in future version of Vanilla
8
8
  $border: $input-border-thickness solid $color-mid-light !default;
9
- $box-shadow: 0 1px 1px 0 transparentize($color-x-dark, 0.85), 0 2px 2px -1px transparentize($color-x-dark, 0.85), 0 0 3px 0 transparentize($color-x-dark, 0.8) !default;
9
+ $box-shadow:
10
+ 0 1px 1px 0 transparentize($color-x-dark, 0.85),
11
+ 0 2px 2px -1px transparentize($color-x-dark, 0.85),
12
+ 0 0 3px 0 transparentize($color-x-dark, 0.8) !default;
10
13
  $box-shadow--deep: 0 0 2rem 0 rgba($color-x-dark, $shadow-opacity) !default;