vanilla-framework 3.11.0 → 3.12.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
@@ -1,4 +1,6 @@
1
1
  {
2
+ "name": "vanilla-framework",
3
+ "version": "3.12.1",
2
4
  "author": {
3
5
  "email": "webteam@canonical.com",
4
6
  "name": "Canonical Webteam"
@@ -20,7 +22,6 @@
20
22
  "module"
21
23
  ],
22
24
  "license": "LGPL-3.0",
23
- "name": "vanilla-framework",
24
25
  "repository": {
25
26
  "type": "git",
26
27
  "url": "https://github.com/canonical/vanilla-framework"
@@ -47,7 +48,6 @@
47
48
  "percy": "percy exec -- node snapshots.js",
48
49
  "icon-svgs-to-mixins": "node scripts/convert-svgs-to-icon-mixins.js icons"
49
50
  },
50
- "version": "3.11.0",
51
51
  "files": [
52
52
  "_index.scss",
53
53
  "/scss",
@@ -61,19 +61,19 @@
61
61
  "postcss": "8.4.21",
62
62
  "postcss-cli": "9.1.0",
63
63
  "postcss-scss": "4.0.6",
64
- "sass": "1.57.1",
64
+ "sass": "1.58.3",
65
65
  "yaml": "1.10.2"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@percy/script": "1.1.0",
69
- "@testing-library/cypress": "8.0.7",
70
- "cypress": "10.11.0",
69
+ "@testing-library/cypress": "9.0.0",
70
+ "cypress": "12.7.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.8.2",
74
+ "prettier": "2.8.4",
75
75
  "stylelint": "14.16.1",
76
- "stylelint-config-prettier": "9.0.4",
76
+ "stylelint-config-prettier": "9.0.5",
77
77
  "stylelint-config-recommended-scss": "5.0.2",
78
78
  "stylelint-order": "5.0.0",
79
79
  "stylelint-prettier": "2.0.0",
@@ -7,7 +7,7 @@
7
7
  font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
8
8
  font-style: normal;
9
9
  font-weight: 100 800; /* min and max value for the weight axis */
10
- src: url('#{$assets-path}f3b9cc97-Ubuntu[wdth,wght]-latin.woff2') format('woff2-variations');
10
+ src: url('#{$assets-path}15be2ffe-UbuntuBeta0.865[wdth,wght]-latin.woff2') format('woff2-variations');
11
11
  }
12
12
 
13
13
  @font-face {
@@ -15,14 +15,14 @@
15
15
  font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
16
16
  font-style: italic;
17
17
  font-weight: 100 800; /* min and max value for the weight axis */
18
- src: url('#{$assets-path}c1b12cdf-Ubuntu-Italic[wdth,wght]-latin.woff2') format('woff2-variations');
18
+ src: url('#{$assets-path}a84821f4-UbuntuBeta0.865-Italic[wdth,wght]-latin.woff2') format('woff2-variations');
19
19
  }
20
20
 
21
21
  @font-face {
22
22
  font-family: 'Ubuntu Mono variable';
23
23
  font-style: normal;
24
24
  font-weight: 100 800; /* min and max value for the weight axis */
25
- src: url('#{$assets-path}0bd4277a-UbuntuMono[wght]-latin.woff2') format('woff2-variations');
25
+ src: url('#{$assets-path}ec568c8f-UbuntuMonoBeta0.865[wght]-latin.woff2') format('woff2-variations');
26
26
  }
27
27
 
28
28
  @if $font-allow-cyrillic-greek-latin {
@@ -32,7 +32,7 @@
32
32
  font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
33
33
  font-style: normal;
34
34
  font-weight: 100 800; /* min and max value for the weight axis */
35
- src: url('#{$assets-path}7d55b1fc-Ubuntu[wdth,wght]-cyrillic-extended.woff2') format('woff2-variations');
35
+ src: url('#{$assets-path}929e5b64-UbuntuBeta0.865[wdth,wght]-cyrillic-extended.woff2') format('woff2-variations');
36
36
  unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
37
37
  }
38
38
 
@@ -42,7 +42,7 @@
42
42
  font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
43
43
  font-style: normal;
44
44
  font-weight: 100 800; /* min and max value for the weight axis */
45
- src: url('#{$assets-path}086e42aa-Ubuntu[wdth,wght]-cyrillic.woff2') format('woff2-variations');
45
+ src: url('#{$assets-path}ec29c093-UbuntuBeta0.865[wdth,wght]-cyrillic.woff2') format('woff2-variations');
46
46
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
47
47
  }
48
48
 
@@ -52,7 +52,7 @@
52
52
  font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
53
53
  font-style: normal;
54
54
  font-weight: 100 800; /* min and max value for the weight axis */
55
- src: url('#{$assets-path}77e5f6a2-Ubuntu[wdth,wght]-greek-extended.woff2') format('woff2-variations');
55
+ src: url('#{$assets-path}0a8276a6-UbuntuBeta0.865[wdth,wght]-greek-extended.woff2') format('woff2-variations');
56
56
  unicode-range: U+1F00-1FFF;
57
57
  }
58
58
 
@@ -62,7 +62,7 @@
62
62
  font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
63
63
  font-style: normal;
64
64
  font-weight: 100 800; /* min and max value for the weight axis */
65
- src: url('#{$assets-path}57fdffc1-Ubuntu[wdth,wght]-greek.woff2') format('woff2-variations');
65
+ src: url('#{$assets-path}16acdbb4-UbuntuBeta0.865[wdth,wght]-greek.woff2') format('woff2-variations');
66
66
  unicode-range: U+0370-03FF;
67
67
  }
68
68
 
@@ -72,7 +72,7 @@
72
72
  font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
73
73
  font-style: normal;
74
74
  font-weight: 100 800; /* min and max value for the weight axis */
75
- src: url('#{$assets-path}a312a7ed-Ubuntu[wdth,wght]-latin-extended.woff2') format('woff2-variations');
75
+ src: url('#{$assets-path}c81d0142-UbuntuBeta0.865[wdth,wght]-latin-extended.woff2') format('woff2-variations');
76
76
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
77
77
  }
78
78
  }
@@ -6,7 +6,7 @@
6
6
  hr {
7
7
  @extend %hr;
8
8
 
9
- margin-bottom: calc($spv--small - $input-border-thickness);
9
+ margin-bottom: calc($spv--small - 1px);
10
10
 
11
11
  &.u-no-margin--bottom {
12
12
  // compensate for hr thickness, to make sure it doesn't drift from baseline grid
@@ -76,7 +76,7 @@
76
76
  %vf-heading-4 {
77
77
  font-size: #{map-get($font-sizes, h4-mobile)}rem;
78
78
  font-style: normal;
79
- font-weight: $font-weight-regular-text;
79
+ font-weight: $font-weight-thin;
80
80
  line-height: map-get($line-heights, h4-mobile);
81
81
  margin-bottom: map-get($sp-after, h4-mobile) - map-get($nudges, h4-mobile);
82
82
  margin-top: 0;
@@ -146,6 +146,8 @@
146
146
 
147
147
  %default-text {
148
148
  @extend %common-default-text-properties;
149
+ font-size: 1rem;
150
+ font-weight: $font-weight-regular-text;
149
151
 
150
152
  margin-bottom: map-get($sp-after, default-text) - map-get($nudges, p);
151
153
  }
@@ -203,19 +205,36 @@
203
205
  color: $colors--light-theme--text-muted;
204
206
  }
205
207
 
208
+ %small-caps-text {
209
+ @extend %default-text;
210
+ font-variant-caps: all-small-caps;
211
+ letter-spacing: 0.05em;
212
+ margin-bottom: map-get($sp-after, default-text) - map-get($nudges, p);
213
+
214
+ &.u-no-margin--bottom {
215
+ @extend %u-no-margin--bottom--small;
216
+ }
217
+
218
+ // deprecated: the use of .u-align-text--x-small-to-default on small caps text is deprecated
219
+ // previously small caps was implemented as x-small text variant requiring .u-align-text--x-small-to-default compensations
220
+ // but now it's implemented with default text size not requiring any compensations,
221
+ // so we need to reset the padding-top to the default value
222
+ &.u-align-text--x-small-to-default {
223
+ padding-top: map-get($nudges, p) + map-get($browser-rounding-compensations, p);
224
+ }
225
+ }
226
+
206
227
  %table-header-label {
228
+ // TODO: table header should use %small-caps-text,
229
+ // but we need to test it in the context of MAAS dense tables first
207
230
  @extend %x-small-text;
208
231
 
209
232
  text-transform: uppercase;
210
233
  }
211
234
 
235
+ // deprecated: %muted-text is deprecated, use %small-caps-text instead
212
236
  %muted-heading {
213
- @extend %muted-text;
214
- @extend %table-header-label;
215
-
216
- &.u-no-margin--bottom {
217
- @extend %u-no-margin--bottom--small;
218
- }
237
+ @extend %small-caps-text;
219
238
  }
220
239
 
221
240
  %bold {
@@ -78,11 +78,10 @@
78
78
  @extend %x-small-text;
79
79
  }
80
80
 
81
+ .p-text--small-caps,
82
+ // deprecated: .p-text--x-small-capitalised is deprecated, use .p-text--small-caps instead
81
83
  .p-text--x-small-capitalised {
82
- @extend %x-small-text;
83
-
84
- font-weight: $font-weight-bold;
85
- text-transform: uppercase;
84
+ @extend %small-caps-text;
86
85
  }
87
86
 
88
87
  //@section Adjusted spacing for headings (or a p) following a paragraph
@@ -223,18 +223,18 @@ $application-layout--side-nav-width-expanded: 15rem !default;
223
223
 
224
224
  // Other panels
225
225
  // --------------
226
- .l-main {
226
+ .l-application .l-main {
227
227
  grid-area: main;
228
228
  overflow-y: auto;
229
229
  }
230
230
 
231
- .l-status {
231
+ .l-application .l-status {
232
232
  border-top: 1px solid $colors--light-theme--border-low-contrast;
233
233
  grid-area: status;
234
234
  z-index: 102;
235
235
  }
236
236
 
237
- .l-aside {
237
+ .l-application .l-aside {
238
238
  @include vf-transition($property: #{transform, box-shadow, visibility}, $duration: snap);
239
239
 
240
240
  box-shadow: $panel-drop-shadow;
@@ -11,6 +11,11 @@
11
11
  // like: https://github.com/canonical/jaas-dashboard/blob/b9ca3876d054c48dc2da74df0080cd14a0f15740/src/scss/index.scss#L28
12
12
 
13
13
  @media (min-width: $breakpoint-large) {
14
+ // stylelint-disable-next-line selector-max-type
15
+ body {
16
+ position: relative;
17
+ }
18
+
14
19
  .l-full-width__sidebar {
15
20
  background: $color-light;
16
21
 
@@ -2,11 +2,12 @@
2
2
 
3
3
  @mixin vf-p-article-pagination {
4
4
  %chevron-icon {
5
- color: $color-mid-dark;
6
- content: '\203A';
7
- font-size: 2em;
5
+ @extend %icon;
6
+ @include vf-icon-chevron($color-mid-dark);
7
+
8
+ content: '';
8
9
  position: absolute;
9
- top: 1rem;
10
+ top: calc($spv--large + $spv--x-small);
10
11
  }
11
12
 
12
13
  .p-article-pagination {
@@ -74,7 +75,7 @@
74
75
  @extend %chevron-icon;
75
76
 
76
77
  left: $sp-small;
77
- transform: scaleX(-1);
78
+ transform: rotate(90deg);
78
79
  }
79
80
  }
80
81
 
@@ -96,6 +97,7 @@
96
97
  @extend %chevron-icon;
97
98
 
98
99
  right: $sp-small;
100
+ transform: rotate(-90deg);
99
101
  }
100
102
  }
101
103
  }
@@ -64,33 +64,23 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
64
64
 
65
65
  %vf-list-item-state-base {
66
66
  @extend %vf-list;
67
-
68
- background-position-y: $spv--x-small + $list-status-icon-nudge;
69
67
  background-repeat: no-repeat;
70
68
  background-size: $list-status-icon-height;
71
- padding-left: 2rem;
69
+ content: '';
70
+ display: inline-block;
71
+ height: $sph--large;
72
+ margin-right: $sph--large;
73
+ position: relative;
74
+ top: $sph--x-small;
75
+ width: $sph--large;
72
76
  }
73
77
  }
74
78
 
75
79
  @mixin vf-list-item-divided {
76
- position: relative;
77
-
78
- &::after {
79
- border-bottom: 1px solid $color-mid-light;
80
- bottom: 0;
81
- content: '';
82
- height: 1px;
83
- left: 0;
84
- position: absolute;
85
- right: 0;
86
- }
87
-
88
- &:last-of-type,
89
- .last-item {
90
- &::after {
91
- border-bottom: 0;
92
- }
93
- }
80
+ box-shadow: inset 0px 1px 0px 0rem $color-mid-x-light;
81
+ margin: 0;
82
+ padding-bottom: $sph--large;
83
+ padding-top: $sph--small;
94
84
  }
95
85
 
96
86
  // Mixin for inline list items
@@ -125,6 +115,22 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
125
115
  }
126
116
  }
127
117
 
118
+ %vf-list-item-ordered {
119
+ &::marker {
120
+ content: none;
121
+ display: none;
122
+ }
123
+
124
+ &::before {
125
+ color: $color-dark;
126
+ content: counters(list-item, '.') '. ';
127
+ display: inline-block;
128
+ margin-right: $sph--large;
129
+ text-align: right;
130
+ width: $sph--large;
131
+ }
132
+ }
133
+
128
134
  // A list with separators between items
129
135
  @mixin vf-p-list-divided {
130
136
  .p-list--divided {
@@ -138,22 +144,61 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
138
144
  &.is-split .p-list__item:last-of-type {
139
145
  border-bottom: 1px solid $color-mid-light;
140
146
  }
147
+
148
+ & & {
149
+ margin-bottom: 0;
150
+ margin-left: $sp-x-large;
151
+ padding-top: $sph--large;
152
+
153
+ .p-list__item:last-child {
154
+ padding-bottom: 0;
155
+ }
156
+ }
141
157
  }
158
+
159
+ // stylelint-disable selector-max-type -- we want to target ordered lists
160
+ ol.p-list--divided {
161
+ list-style: none;
162
+ .p-list__item {
163
+ @extend %vf-list-item-ordered;
164
+ }
165
+ }
166
+ // stylelint-enable selector-max-type -- we want to target ordered lists
142
167
  }
143
168
 
144
169
  // Displays item with a state icon
145
170
  @mixin vf-p-list-item-state {
146
171
  .is-ticked {
147
- @extend %vf-list-item-state-base;
148
- @include vf-icon-success;
172
+ &::before {
173
+ @extend %vf-list-item-state-base;
174
+ @include vf-icon-success;
175
+ }
149
176
  }
150
177
 
151
178
  .is-crossed {
152
- @extend %vf-list-item-state-base;
153
- @include vf-icon-error;
179
+ &::before {
180
+ @extend %vf-list-item-state-base;
181
+ @include vf-icon-error;
182
+ }
183
+ }
184
+ }
185
+
186
+ %vf-list-item-bullet {
187
+ &::before {
188
+ color: $color-dark;
189
+ content: '•';
190
+ display: inline-block;
191
+ margin-right: $sph--large;
192
+ text-align: right;
193
+ width: $sph--large;
154
194
  }
155
195
  }
156
196
 
197
+ // Displays item with a bullet
198
+ .has-bullet {
199
+ @extend %vf-list-item-bullet;
200
+ }
201
+
157
202
  // Displays a list inline with spacing
158
203
  @mixin vf-p-inline-list {
159
204
  .p-inline-list {
@@ -288,6 +333,10 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
288
333
  width: $bullet-width;
289
334
  }
290
335
  }
336
+ .p-strip--dark &::before {
337
+ background-color: $color-x-dark;
338
+ border: 1px solid $color-x-light;
339
+ }
291
340
  }
292
341
 
293
342
  .p-stepped-list__title + .p-stepped-list__content {
@@ -1,6 +1,6 @@
1
1
  @use 'sass:math';
2
2
 
3
- @mixin vf-p-set-logo-section-item-width($breakpoint: small) {
3
+ @mixin vf-p-set-logo-section-item-width($breakpoint: small, $column-span: 1) {
4
4
  // This mixin calculates the width of an individual logo.
5
5
 
6
6
  $grid-column-count: $grid-columns-small;
@@ -26,7 +26,7 @@
26
26
  $gutter: map-get($grid-gutter-widths, default);
27
27
  $media-query-keyword: min-width;
28
28
  $media-query-width: $threshold-6-12-col;
29
- $logo-column-span: 2;
29
+ $logo-column-span: $column-span;
30
30
  }
31
31
 
32
32
  @media ($media-query-keyword: #{$media-query-width}) {
@@ -141,7 +141,11 @@
141
141
 
142
142
  @include vf-p-set-logo-section-item-width($breakpoint: small);
143
143
  @include vf-p-set-logo-section-item-width($breakpoint: medium);
144
- @include vf-p-set-logo-section-item-width($breakpoint: large);
144
+ @include vf-p-set-logo-section-item-width($breakpoint: large, $column-span: 2);
145
+
146
+ .p-logo-section--dense & {
147
+ @include vf-p-set-logo-section-item-width($breakpoint: large);
148
+ }
145
149
  }
146
150
 
147
151
  .p-logo-section__logo {
@@ -1,5 +1,6 @@
1
+ // deprecated: .p-muted-heading and vf-p-muted-heading is deprecated, use .p-text--small-caps instead
1
2
  @mixin vf-p-muted-heading {
2
3
  .p-muted-heading {
3
- @extend %muted-heading;
4
+ @extend %small-caps-text;
4
5
  }
5
6
  }
@@ -66,7 +66,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
66
66
  border-radius: 0;
67
67
 
68
68
  display: block;
69
- font-weight: $font-weight-bold;
69
+ font-weight: $font-weight-regular-text;
70
70
  line-height: map-get($line-heights, default-text);
71
71
  margin: 0;
72
72
  overflow: hidden;
@@ -72,7 +72,7 @@
72
72
  .p-search-and-filter__panel {
73
73
  @include vf-transition(opacity, fast);
74
74
 
75
- background-color: $colors--light-theme--background-inputs;
75
+ background-color: $color-x-light;
76
76
  border-radius: $border-radius;
77
77
  box-shadow: $box-shadow;
78
78
  opacity: 1;
@@ -12,6 +12,7 @@ $base-font-sizes: (
12
12
  large: $font-size-largescreen,
13
13
  ) !default;
14
14
  $font-weight-display-heading: 100 !default;
15
+ $font-weight-thin: 300 !default;
15
16
  $font-weight-regular-text: 400 !default;
16
17
  $font-weight-bold: 550 !default;
17
18
 
@@ -18,7 +18,7 @@ $font-sizes: (
18
18
  h4-mobile: 1.22176,
19
19
  small: pow($ms-ratio, -1),
20
20
  x-small: pow($ms-ratio, -2),
21
- );
21
+ ) !default;
22
22
 
23
23
  $line-heights: (
24
24
  h1: 7 * $sp-unit,
@@ -0,0 +1,6 @@
1
+ @mixin vf-u-has-icon {
2
+ .u-has-icon [class*='p-icon--']:first-child {
3
+ margin-right: $sph--small;
4
+ margin-top: $spv--small;
5
+ }
6
+ }
@@ -3,7 +3,8 @@
3
3
  @extend %fixed-width-container;
4
4
 
5
5
  & &,
6
- .row & {
6
+ .row &,
7
+ & .row {
7
8
  @include vf-b-row-reset;
8
9
  }
9
10
  }
@@ -2,12 +2,12 @@
2
2
 
3
3
  // Positions element out of flow & off screen for screen readers
4
4
  @mixin vf-u-off-screen {
5
- .u-off-screen {
6
- height: 0 !important;
7
- left: -10000px !important;
8
- overflow: hidden !important;
9
- position: absolute !important;
10
- top: auto !important;
11
- width: 1px !important;
5
+ .u-off-screen:not(:focus):not(:active) {
6
+ clip-path: inset(50%);
7
+ height: 1px;
8
+ overflow: hidden;
9
+ position: absolute;
10
+ white-space: nowrap;
11
+ width: 1px;
12
12
  }
13
13
  }
@@ -67,6 +67,7 @@
67
67
  @import 'utilities_equal-height';
68
68
  @import 'utilities_floats';
69
69
  @import 'utilities_font-metrics';
70
+ @import 'utilities_has-icon';
70
71
  @import 'utilities_hide';
71
72
  @import 'utilities_image-position';
72
73
  @import 'utilities_layout';
@@ -150,6 +151,7 @@
150
151
  @include vf-u-embedded-media;
151
152
  @include vf-u-equal-height;
152
153
  @include vf-u-floats;
154
+ @include vf-u-has-icon;
153
155
  @include vf-u-image-position;
154
156
  @include vf-u-layout;
155
157
  @include vf-u-margin-collapse;