vanilla-framework 3.13.0 → 3.14.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,13 +1,13 @@
1
1
  {
2
2
  "name": "vanilla-framework",
3
- "version": "3.13.0",
3
+ "version": "3.14.0",
4
4
  "author": {
5
5
  "email": "webteam@canonical.com",
6
6
  "name": "Canonical Webteam"
7
7
  },
8
8
  "bugs": {
9
9
  "email": "webteam@canonical.com",
10
- "url": "http://github.com/canonical/vanilla-framework/issues"
10
+ "url": "https://github.com/canonical/vanilla-framework/issues"
11
11
  },
12
12
  "description": "A simple, extendable CSS framework.",
13
13
  "homepage": "https://vanillaframework.io/",
@@ -54,29 +54,27 @@
54
54
  "!/scss/docs",
55
55
  "!/scss/standalone"
56
56
  ],
57
- "dependencies": {
57
+ "devDependencies": {
58
58
  "@canonical/cookie-policy": "3.4.0",
59
59
  "@canonical/latest-news": "1.4.1",
60
- "autoprefixer": "10.4.13",
61
- "postcss": "8.4.21",
62
- "postcss-cli": "9.1.0",
63
- "postcss-scss": "4.0.6",
64
- "sass": "1.58.3",
65
- "yaml": "1.10.2"
66
- },
67
- "devDependencies": {
68
60
  "@percy/script": "1.1.0",
69
61
  "@testing-library/cypress": "9.0.0",
62
+ "autoprefixer": "10.4.13",
70
63
  "cypress": "12.7.0",
71
64
  "get-site-urls": "3.0.0",
72
65
  "markdown-spellcheck": "1.3.1",
73
66
  "parker": "0.0.10",
67
+ "postcss": "8.4.21",
68
+ "postcss-cli": "9.1.0",
69
+ "postcss-scss": "4.0.6",
74
70
  "prettier": "2.8.4",
71
+ "sass": "1.58.3",
75
72
  "stylelint": "14.16.1",
76
73
  "stylelint-config-prettier": "9.0.5",
77
74
  "stylelint-config-recommended-scss": "5.0.2",
78
75
  "stylelint-order": "5.0.0",
79
76
  "stylelint-prettier": "2.0.0",
80
- "svgo": "2.8.0"
77
+ "svgo": "2.8.0",
78
+ "yaml": "2.2.2"
81
79
  }
82
80
  }
@@ -1,5 +1,27 @@
1
1
  @import 'settings';
2
2
 
3
+ %fixed-width-hr {
4
+ @mixin adjusted-width($size) {
5
+ $gutters-sizes: 2 * map-get($grid-margin-widths, $size);
6
+
7
+ max-width: calc($grid-max-width - $gutters-sizes);
8
+ width: calc(100% - $gutters-sizes);
9
+ }
10
+
11
+ margin-left: auto;
12
+ margin-right: auto;
13
+ @include adjusted-width(small);
14
+
15
+ @media (min-width: $threshold-4-6-col) {
16
+ @include adjusted-width(default);
17
+ }
18
+
19
+ .row &,
20
+ .u-fixed-width & {
21
+ width: 100%;
22
+ }
23
+ }
24
+
3
25
  // Horizontal rule
4
26
  @mixin vf-b-hr {
5
27
  // stylelint-disable selector-max-type -- base styles can use type selectors
@@ -18,25 +40,7 @@
18
40
  }
19
41
 
20
42
  &.is-fixed-width {
21
- margin-left: auto;
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));
25
-
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));
29
- }
30
-
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));
34
- }
35
-
36
- .row &,
37
- .u-fixed-width & {
38
- width: 100%;
39
- }
43
+ @extend %fixed-width-hr;
40
44
  }
41
45
  }
42
46
 
@@ -5,7 +5,6 @@
5
5
  // stylelint-disable selector-max-type -- base styles can use type selectors
6
6
  img {
7
7
  border: 0;
8
- border-radius: $border-radius;
9
8
  height: auto;
10
9
  max-width: 100%;
11
10
  }
@@ -100,13 +100,8 @@
100
100
 
101
101
  // Spacing
102
102
  %section-padding--shallow {
103
- padding-bottom: $spv--x-large * 0.5;
104
- padding-top: $spv--x-large * 0.5;
105
-
106
- @media (min-width: $breakpoint-large) {
107
- padding-bottom: $spv--x-large;
108
- padding-top: $spv--x-large;
109
- }
103
+ padding-bottom: $spv--x-large;
104
+ padding-top: $spv--x-large;
110
105
  }
111
106
 
112
107
  %section-padding--default {
@@ -37,6 +37,7 @@
37
37
  @mixin vf-p-grid {
38
38
  // FIXME: this should be removed from framework SCSS
39
39
  // (see https://github.com/canonical/vanilla-framework/issues/3199)
40
+ .grid-demo .col,
40
41
  .grid-demo [class*='#{$grid-column-prefix}'] {
41
42
  background: transparentize($color-negative, 0.9);
42
43
  margin-bottom: $spv--small;
@@ -188,4 +189,100 @@
188
189
  }
189
190
  }
190
191
  }
192
+
193
+ // Common grid patterns
194
+ $col-50-medium: calc($grid-columns-medium / 2);
195
+
196
+ $col-25: calc($grid-columns / 4);
197
+ $col-50: calc($grid-columns / 2);
198
+ $col-75: calc(($grid-columns / 4) * 3);
199
+
200
+ .row--50-50 {
201
+ @extend %vf-row;
202
+
203
+ > .col {
204
+ @include vf-grid-column($grid-columns-small);
205
+
206
+ @media (min-width: $threshold-4-6-col) {
207
+ @include vf-grid-column($col-50-medium);
208
+ }
209
+
210
+ @media (min-width: $threshold-6-12-col) {
211
+ @include vf-grid-column($col-50);
212
+ }
213
+ }
214
+ }
215
+
216
+ .row--25-75 {
217
+ @extend %vf-row;
218
+
219
+ > .col {
220
+ @include vf-grid-column($grid-columns-small);
221
+
222
+ @media (min-width: $threshold-4-6-col) {
223
+ @include vf-grid-column($grid-columns-medium);
224
+ }
225
+
226
+ @media (min-width: $threshold-6-12-col) {
227
+ &:nth-of-type(1) {
228
+ @include vf-grid-column($col-25);
229
+ }
230
+
231
+ &:nth-of-type(2) {
232
+ @include vf-grid-column($col-75);
233
+ }
234
+
235
+ // if there is only one column we offset it to the right
236
+ &:only-of-type {
237
+ grid-column-start: calc($col-25 + 1);
238
+ @include vf-grid-column($col-75);
239
+ }
240
+ }
241
+ }
242
+ }
243
+
244
+ .row--25-25-50 {
245
+ @extend %vf-row;
246
+
247
+ > .col {
248
+ @include vf-grid-column($grid-columns-small);
249
+
250
+ @media (min-width: $threshold-4-6-col) {
251
+ &:nth-of-type(-n + 2) {
252
+ @include vf-grid-column($col-50-medium);
253
+ }
254
+
255
+ &:nth-of-type(3) {
256
+ @include vf-grid-column($grid-columns-medium);
257
+ }
258
+ }
259
+
260
+ @media (min-width: $threshold-6-12-col) {
261
+ &:nth-of-type(1),
262
+ &:nth-of-type(2) {
263
+ @include vf-grid-column($col-25);
264
+ }
265
+
266
+ &:nth-of-type(3) {
267
+ @include vf-grid-column($col-50);
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ .row--25-25-25-25 {
274
+ @extend %vf-row;
275
+
276
+ > .col {
277
+ @include vf-grid-column($grid-columns-small);
278
+
279
+ @media (min-width: $threshold-4-6-col) {
280
+ @include vf-grid-column($col-50-medium);
281
+ }
282
+
283
+ @media (min-width: $threshold-6-12-col) {
284
+ @include vf-grid-column($col-25);
285
+ }
286
+ }
287
+ }
191
288
  }
@@ -116,6 +116,14 @@ $list-status-icon-height: $default-icon-size;
116
116
  margin: 0;
117
117
  padding-bottom: $sph--large;
118
118
  padding-top: $sph--small;
119
+
120
+ &:first-child {
121
+ box-shadow: none;
122
+ }
123
+
124
+ .p-list--divided > .p-list__item:first-child {
125
+ box-shadow: inset 0px 1px 0px 0px $color-mid-x-light;
126
+ }
119
127
  }
120
128
 
121
129
  // Mixin for inline list items
@@ -468,6 +476,7 @@ $list-status-icon-height: $default-icon-size;
468
476
  columns: 2;
469
477
 
470
478
  .p-list__item {
479
+ display: inline-block;
471
480
  width: 100%;
472
481
  }
473
482
  }
@@ -0,0 +1,12 @@
1
+ @import 'settings';
2
+
3
+ @mixin vf-p-rule {
4
+ .p-rule,
5
+ .p-rule--highlight {
6
+ @extend %u-no-margin--bottom--hr;
7
+ }
8
+
9
+ .p-rule--highlight {
10
+ @include vf-highlight-bar($color-dark);
11
+ }
12
+ }
@@ -0,0 +1,15 @@
1
+ @mixin vf-p-section {
2
+ .p-section {
3
+ // same as %section-padding--default
4
+ padding-bottom: $spv--strip-regular * 0.5;
5
+
6
+ @media (min-width: $breakpoint-large) {
7
+ padding-bottom: $spv--strip-regular;
8
+ }
9
+ }
10
+
11
+ .p-block {
12
+ // same as %section-padding--shallow
13
+ padding-bottom: $spv--x-large;
14
+ }
15
+ }
@@ -75,8 +75,9 @@ $spv--small: $sp-unit !default;
75
75
  $spv--medium: $sp-unit * 1.5 !default;
76
76
  $spv--large: $sp-unit * 2;
77
77
  $spv--x-large: $sp-unit * 3 !default;
78
+ $spv--strip-shallow: $sp-unit * 3 !default;
78
79
  $spv--strip-regular: $sp-unit * 8 !default;
79
- $spv--strip-deep: $sp-unit * 12 !default;
80
+ $spv--strip-deep: $sp-unit * 16 !default;
80
81
 
81
82
  $sph--x-small: $sp-unit * 0.5 !default; // to be used in place of an inline space between characters/words
82
83
  $sph--small: $sp-unit !default;
@@ -34,8 +34,10 @@
34
34
  @import 'patterns_notifications';
35
35
  @import 'patterns_pagination';
36
36
  @import 'patterns_pull-quotes';
37
+ @import 'patterns_rule';
37
38
  @import 'patterns_search-and-filter';
38
39
  @import 'patterns_search-box';
40
+ @import 'patterns_section';
39
41
  @import 'patterns_separator';
40
42
  @import 'patterns_side-navigation';
41
43
  @import 'patterns_side-navigation-expandable';
@@ -92,6 +94,7 @@
92
94
  @include vf-p-buttons;
93
95
  @include vf-p-card;
94
96
  @include vf-p-chip;
97
+ @include vf-p-section;
95
98
  @include vf-p-badge;
96
99
  @include vf-p-code-snippet;
97
100
  @include vf-p-contextual-menu;
@@ -119,6 +122,7 @@
119
122
  @include vf-p-notification;
120
123
  @include vf-p-pagination;
121
124
  @include vf-p-pull-quotes;
125
+ @include vf-p-rule;
122
126
  @include vf-p-search-and-filter;
123
127
  @include vf-p-search-box;
124
128
  @include vf-p-segmented-control;