vanilla-framework 4.0.0 → 4.1.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/README.md +1 -1
- package/package.json +3 -3
- package/scss/_base_typography-definitions.scss +17 -0
- package/scss/_patterns_breadcrumbs.scss +6 -6
- package/scss/_patterns_chip.scss +6 -11
- package/scss/_patterns_grid.scss +36 -0
- package/scss/_patterns_headings.scss +4 -0
- package/scss/_patterns_suru.scss +22 -0
- package/scss/_patterns_tabs.scss +87 -8
- package/scss/_settings_spacing.scss +8 -0
- package/scss/_settings_themes.scss +1 -0
- package/scss/_vanilla.scss +2 -0
package/README.md
CHANGED
|
@@ -84,6 +84,6 @@ Keep up to date with all new developments and upcoming changes with Vanilla.
|
|
|
84
84
|
- Follow us on Twitter [@vanillaframewrk](https://twitter.com/vanillaframewrk)
|
|
85
85
|
- Read our latest blog posts at [Ubuntu Blog](https://blog.ubuntu.com/topics/design)
|
|
86
86
|
|
|
87
|
-
Code licensed [LGPLv3](
|
|
87
|
+
Code licensed [LGPLv3](https://opensource.org/license/lgpl-3-0/) by [Canonical Ltd](http://www.canonical.com/)
|
|
88
88
|
|
|
89
89
|
With ♥ from Canonical
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vanilla-framework",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "webteam@canonical.com",
|
|
6
6
|
"name": "Canonical Webteam"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"!/scss/standalone"
|
|
56
56
|
],
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@canonical/cookie-policy": "3.
|
|
58
|
+
"@canonical/cookie-policy": "3.5.0",
|
|
59
59
|
"@canonical/latest-news": "1.4.1",
|
|
60
60
|
"@percy/cli": "1.26.0",
|
|
61
61
|
"@testing-library/cypress": "9.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"postcss-scss": "4.0.6",
|
|
70
70
|
"prettier": "2.8.8",
|
|
71
71
|
"sass": "1.62.1",
|
|
72
|
-
"stylelint": "
|
|
72
|
+
"stylelint": "15.10.1",
|
|
73
73
|
"stylelint-config-prettier": "9.0.5",
|
|
74
74
|
"stylelint-config-recommended-scss": "5.0.2",
|
|
75
75
|
"stylelint-order": "5.0.0",
|
|
@@ -35,6 +35,23 @@
|
|
|
35
35
|
font-weight: 550;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
%vf-heading-display {
|
|
39
|
+
@extend %vf-heading-2;
|
|
40
|
+
|
|
41
|
+
font-size: #{map-get($font-sizes, display-mobile)}rem;
|
|
42
|
+
font-weight: 100;
|
|
43
|
+
line-height: map-get($line-heights, display-mobile);
|
|
44
|
+
margin-bottom: map-get($sp-after, display-mobile) - map-get($nudges, display-mobile);
|
|
45
|
+
padding-top: map-get($nudges, display-mobile);
|
|
46
|
+
|
|
47
|
+
@media (min-width: $breakpoint-heading-threshold) {
|
|
48
|
+
font-size: #{map-get($font-sizes, display)}rem;
|
|
49
|
+
line-height: map-get($line-heights, display);
|
|
50
|
+
margin-bottom: map-get($sp-after, display) - map-get($nudges, display);
|
|
51
|
+
padding-top: map-get($nudges, display);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
38
55
|
%vf-heading-3 {
|
|
39
56
|
@extend %vf-is-accent;
|
|
40
57
|
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
margin: 0;
|
|
8
8
|
padding: 0;
|
|
9
9
|
width: 100%;
|
|
10
|
+
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
.p-breadcrumbs__items {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
margin-left: 0;
|
|
15
|
+
padding-left: 0;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
.p-breadcrumbs__item {
|
|
18
|
-
@extend %
|
|
19
|
+
@extend %small-caps-text;
|
|
19
20
|
|
|
20
21
|
display: inline-block;
|
|
21
|
-
margin-bottom: $spv-nudge-compensation;
|
|
22
22
|
|
|
23
23
|
&:not(:first-of-type) {
|
|
24
24
|
text-indent: $sph--large;
|
package/scss/_patterns_chip.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use 'sass:math';
|
|
2
2
|
@import 'settings';
|
|
3
|
+
$chip-border-thickness: 1px;
|
|
3
4
|
|
|
4
5
|
@mixin vf-p-chip {
|
|
5
6
|
%vf-chip {
|
|
@@ -12,10 +13,10 @@
|
|
|
12
13
|
display: inline-flex;
|
|
13
14
|
margin: 0 $sph--small $input-margin-bottom 0;
|
|
14
15
|
max-width: 100%;
|
|
15
|
-
padding: calc($spv--x-small - $
|
|
16
|
+
padding: calc($spv--x-small - $chip-border-thickness) $sph--small; // account for border thickness using calc
|
|
16
17
|
position: relative;
|
|
17
18
|
user-select: none;
|
|
18
|
-
vertical-align: calc($
|
|
19
|
+
vertical-align: calc($chip-border-thickness - map-get($nudges, p));
|
|
19
20
|
white-space: nowrap;
|
|
20
21
|
|
|
21
22
|
.p-chip__lead,
|
|
@@ -26,12 +27,11 @@
|
|
|
26
27
|
padding: 0;
|
|
27
28
|
text-overflow: ellipsis;
|
|
28
29
|
vertical-align: baseline;
|
|
30
|
+
@extend %small-text;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
.p-chip__lead {
|
|
32
|
-
@extend %
|
|
33
|
-
|
|
34
|
-
text-transform: uppercase;
|
|
34
|
+
@extend %small-caps-text;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.p-chip__lead + .p-chip__value::before {
|
|
@@ -40,11 +40,6 @@
|
|
|
40
40
|
content: ': ';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.p-chip__value {
|
|
44
|
-
@extend %small-text;
|
|
45
|
-
font-weight: $font-weight-bold;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
43
|
.p-chip__dismiss {
|
|
49
44
|
@extend %icon;
|
|
50
45
|
// also includes button and close icon styles in the theming section
|
|
@@ -242,7 +237,7 @@
|
|
|
242
237
|
$color-border: map-get($colors-chip-tinted-borders, $chip-type);
|
|
243
238
|
|
|
244
239
|
background-color: $color-background;
|
|
245
|
-
border: $
|
|
240
|
+
border: $chip-border-thickness solid $color-border;
|
|
246
241
|
|
|
247
242
|
.p-chip__value {
|
|
248
243
|
color: $color-chip-value;
|
package/scss/_patterns_grid.scss
CHANGED
|
@@ -241,6 +241,42 @@
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
+
.row--25-75.is-split-on-medium {
|
|
245
|
+
> .col {
|
|
246
|
+
@media (min-width: $threshold-4-6-col) {
|
|
247
|
+
&:nth-of-type(1) {
|
|
248
|
+
@include vf-grid-column(2);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&:nth-of-type(2) {
|
|
252
|
+
@include vf-grid-column(4);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// if there is only one column we offset it to the right
|
|
256
|
+
&:only-of-type {
|
|
257
|
+
@include vf-grid-column(4);
|
|
258
|
+
grid-column-start: calc(3);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@media (min-width: $threshold-6-12-col) {
|
|
263
|
+
&:nth-of-type(1) {
|
|
264
|
+
@include vf-grid-column($col-25);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&:nth-of-type(2) {
|
|
268
|
+
@include vf-grid-column($col-75);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// if there is only one column we offset it to the right
|
|
272
|
+
&:only-of-type {
|
|
273
|
+
grid-column-start: calc($col-25 + 1);
|
|
274
|
+
@include vf-grid-column($col-75);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
244
280
|
.row--25-25-50 {
|
|
245
281
|
@extend %vf-row;
|
|
246
282
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@import 'settings';
|
|
2
|
+
|
|
3
|
+
@mixin vf-p-suru {
|
|
4
|
+
.p-suru {
|
|
5
|
+
aspect-ratio: calc(2216 / 428); // aspect ratio calculated from image dimensions
|
|
6
|
+
background-image: url('#{$assets-path}7f34ade9-website_suru_25.jpg');
|
|
7
|
+
background-size: contain;
|
|
8
|
+
display: none; // only show suru on large screens
|
|
9
|
+
margin: 0 auto;
|
|
10
|
+
max-width: $grid-max-width;
|
|
11
|
+
|
|
12
|
+
// show suru only on large screens
|
|
13
|
+
@media (min-width: $breakpoint-large) {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.is-dark {
|
|
18
|
+
aspect-ratio: calc(2580 / 501); // aspect ratio calculated from image dimensions
|
|
19
|
+
background-image: url('#{$assets-path}9469ef82-1_website_suru_DARK_25%20(1)122.jpg');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/scss/_patterns_tabs.scss
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
@import 'settings';
|
|
2
2
|
|
|
3
3
|
@mixin vf-p-tabs {
|
|
4
|
-
// for _patterns_tabs.scss
|
|
5
|
-
$color-tabs-active-bar: $colors--light-theme--text-default !default;
|
|
6
|
-
|
|
7
4
|
.p-tabs {
|
|
8
5
|
border-radius: 0;
|
|
9
6
|
overflow: hidden;
|
|
@@ -44,7 +41,6 @@
|
|
|
44
41
|
|
|
45
42
|
align-items: center;
|
|
46
43
|
border: none;
|
|
47
|
-
color: $colors--light-theme--text-default;
|
|
48
44
|
display: flex;
|
|
49
45
|
gap: $sph--small;
|
|
50
46
|
height: 100%;
|
|
@@ -55,7 +51,6 @@
|
|
|
55
51
|
|
|
56
52
|
&::before {
|
|
57
53
|
@extend %vf-pseudo-border;
|
|
58
|
-
@include vf-transition(#{background-color, border-color}, snap, in);
|
|
59
54
|
|
|
60
55
|
bottom: 0;
|
|
61
56
|
z-index: 1;
|
|
@@ -71,20 +66,88 @@
|
|
|
71
66
|
}
|
|
72
67
|
}
|
|
73
68
|
|
|
69
|
+
&:active,
|
|
70
|
+
&[aria-selected='true'] {
|
|
71
|
+
// Hide the highlight when focussing (in combination with the parent
|
|
72
|
+
// states) in browsers that don't support focus-visible.
|
|
73
|
+
&:focus::before,
|
|
74
|
+
&:focus::after {
|
|
75
|
+
content: none;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Theming
|
|
82
|
+
@if ($theme-default-p-tabs == 'dark') {
|
|
83
|
+
.p-tabs {
|
|
84
|
+
@include vf-p-tabs-dark-theme;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.p-tabs.is-light {
|
|
88
|
+
@include vf-p-tabs-light-theme;
|
|
89
|
+
}
|
|
90
|
+
} @else {
|
|
91
|
+
.p-tabs {
|
|
92
|
+
@include vf-p-tabs-light-theme;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.p-tabs.is-dark {
|
|
96
|
+
@include vf-p-tabs-dark-theme;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@mixin vf-p-tabs-theme($color-tabs-text, $color-tabs-border, $color-tabs-highlight-hover) {
|
|
102
|
+
color: $color-tabs-text;
|
|
103
|
+
.p-tabs {
|
|
104
|
+
&__list::after {
|
|
105
|
+
background-color: $color-tabs-border;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__link {
|
|
109
|
+
background-color: transparent;
|
|
110
|
+
|
|
111
|
+
color: $color-tabs-text;
|
|
112
|
+
@include vf-highlight-bar(transparent, bottom, false);
|
|
113
|
+
|
|
74
114
|
// Display the highlight when focussing in modern browsers that support
|
|
75
115
|
// focus-visible.
|
|
76
116
|
&:focus:not(:focus-visible) {
|
|
77
|
-
@include vf-highlight-bar($color-tabs-
|
|
117
|
+
@include vf-highlight-bar($color-tabs-text, bottom, false);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
@include vf-highlight-bar($color-tabs-highlight-hover, bottom, false);
|
|
122
|
+
|
|
123
|
+
&::before,
|
|
124
|
+
&:focus:not(:focus-visible)::before {
|
|
125
|
+
bottom: 1px;
|
|
126
|
+
height: calc($bar-thickness - 1px);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Display the highlight when focussing (in combination with the parent
|
|
130
|
+
// states) in modern browsers that support focus-visible.
|
|
131
|
+
&:focus:not(:focus-visible) {
|
|
132
|
+
@include vf-highlight-bar($color-tabs-highlight-hover, bottom, false);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Hide the highlight when focussing (in combination with the parent
|
|
136
|
+
// states) in browsers that don't support focus-visible.
|
|
137
|
+
&:focus::before,
|
|
138
|
+
&:focus::after {
|
|
139
|
+
content: none;
|
|
140
|
+
}
|
|
78
141
|
}
|
|
79
142
|
|
|
80
143
|
&:active,
|
|
81
144
|
&[aria-selected='true'] {
|
|
82
|
-
@include vf-highlight-bar($color-tabs-
|
|
145
|
+
@include vf-highlight-bar($color-tabs-text, bottom, false);
|
|
83
146
|
|
|
84
147
|
// Display the highlight when focussing (in combination with the parent
|
|
85
148
|
// states) in modern browsers that support focus-visible.
|
|
86
149
|
&:focus:not(:focus-visible) {
|
|
87
|
-
@include vf-highlight-bar($color-tabs-
|
|
150
|
+
@include vf-highlight-bar($color-tabs-text, bottom, false);
|
|
88
151
|
}
|
|
89
152
|
|
|
90
153
|
// Hide the highlight when focussing (in combination with the parent
|
|
@@ -97,3 +160,19 @@
|
|
|
97
160
|
}
|
|
98
161
|
}
|
|
99
162
|
}
|
|
163
|
+
|
|
164
|
+
@mixin vf-p-tabs-light-theme {
|
|
165
|
+
@include vf-p-tabs-theme(
|
|
166
|
+
$color-tabs-text: $colors--light-theme--text-default,
|
|
167
|
+
$color-tabs-border: $colors--light-theme--border-default,
|
|
168
|
+
$color-tabs-highlight-hover: $colors--light-theme--border-default
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@mixin vf-p-tabs-dark-theme {
|
|
173
|
+
@include vf-p-tabs-theme(
|
|
174
|
+
$color-tabs-text: $colors--dark-theme--text-default,
|
|
175
|
+
$color-tabs-border: $colors--dark-theme--border-default,
|
|
176
|
+
$color-tabs-highlight-hover: $colors--dark-theme--border-default
|
|
177
|
+
);
|
|
178
|
+
}
|
|
@@ -8,6 +8,8 @@ $sp-unit-ratio: 0.5 !default;
|
|
|
8
8
|
$sp-unit: 1rem * $sp-unit-ratio !default;
|
|
9
9
|
|
|
10
10
|
$font-sizes: (
|
|
11
|
+
display: 5,
|
|
12
|
+
display-mobile: 4,
|
|
11
13
|
h1: 2.5,
|
|
12
14
|
h1-mobile: 2,
|
|
13
15
|
h2: 2.5,
|
|
@@ -21,6 +23,8 @@ $font-sizes: (
|
|
|
21
23
|
) !default;
|
|
22
24
|
|
|
23
25
|
$line-heights: (
|
|
26
|
+
display: 11 * $sp-unit,
|
|
27
|
+
display-mobile: 9 * $sp-unit,
|
|
24
28
|
h1: 6 * $sp-unit,
|
|
25
29
|
h1-mobile: 5 * $sp-unit,
|
|
26
30
|
h2: 6 * $sp-unit,
|
|
@@ -36,6 +40,8 @@ $line-heights: (
|
|
|
36
40
|
|
|
37
41
|
// baseline nudges for type scale ratio of (16/14)^2
|
|
38
42
|
$nudges: (
|
|
43
|
+
display: 0.35rem,
|
|
44
|
+
display-mobile: 0.25rem,
|
|
39
45
|
h1-large: 0.55rem,
|
|
40
46
|
h1-mobile: 0.55rem,
|
|
41
47
|
h1: 0.55rem,
|
|
@@ -88,6 +94,8 @@ $sph--x-large: $sp-unit * 3 !default;
|
|
|
88
94
|
|
|
89
95
|
// Space after text elements
|
|
90
96
|
$sp-after: (
|
|
97
|
+
display: $spv--x-large,
|
|
98
|
+
display-mobile: $spv--x-large,
|
|
91
99
|
h1: $spv--x-large,
|
|
92
100
|
h1-mobile: $spv--x-large,
|
|
93
101
|
h2: $spv--x-large,
|
package/scss/_vanilla.scss
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
@import 'patterns_table-sortable';
|
|
54
54
|
@import 'patterns_tabs';
|
|
55
55
|
@import 'patterns_tooltips';
|
|
56
|
+
@import 'patterns_suru';
|
|
56
57
|
|
|
57
58
|
// Layouts
|
|
58
59
|
@import 'layouts_application';
|
|
@@ -142,6 +143,7 @@
|
|
|
142
143
|
@include vf-p-table-sortable;
|
|
143
144
|
@include vf-p-tabs;
|
|
144
145
|
@include vf-p-tooltips;
|
|
146
|
+
@include vf-p-suru;
|
|
145
147
|
|
|
146
148
|
// Layouts
|
|
147
149
|
@include vf-l-application;
|