vanilla-framework 3.11.1 → 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.1",
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.58.0",
64
+ "sass": "1.58.3",
65
65
  "yaml": "1.10.2"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@percy/script": "1.1.0",
69
69
  "@testing-library/cypress": "9.0.0",
70
- "cypress": "12.5.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.3",
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",
@@ -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
  }
@@ -204,10 +206,22 @@
204
206
  }
205
207
 
206
208
  %small-caps-text {
207
- @extend %common-default-text-properties;
209
+ @extend %default-text;
208
210
  font-variant-caps: all-small-caps;
209
211
  letter-spacing: 0.05em;
210
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
+ }
211
225
  }
212
226
 
213
227
  %table-header-label {
@@ -218,13 +232,9 @@
218
232
  text-transform: uppercase;
219
233
  }
220
234
 
235
+ // deprecated: %muted-text is deprecated, use %small-caps-text instead
221
236
  %muted-heading {
222
- @extend %muted-text;
223
- @extend %table-header-label;
224
-
225
- &.u-no-margin--bottom {
226
- @extend %u-no-margin--bottom--small;
227
- }
237
+ @extend %small-caps-text;
228
238
  }
229
239
 
230
240
  %bold {
@@ -78,6 +78,8 @@
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
84
  @extend %small-caps-text;
83
85
  }
@@ -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
  }
@@ -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;
@@ -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
+ }
@@ -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;