vanilla-framework 3.3.0 → 3.6.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 +11 -8
- package/scss/_patterns_badge.scss +34 -0
- package/scss/_patterns_code-snippet.scss +46 -0
- package/scss/_patterns_lists.scss +3 -3
- package/scss/_patterns_navigation.scss +4 -2
- package/scss/_patterns_notifications.scss +52 -0
- package/scss/_patterns_pagination.scss +5 -1
- package/scss/_patterns_side-navigation.scss +101 -8
- package/scss/_patterns_tabs.scss +4 -1
- package/scss/_vanilla.scss +2 -0
package/package.json
CHANGED
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"start": "yarn build && yarn serve",
|
|
30
|
-
"build": "yarn build-scss && yarn build-js",
|
|
31
|
-
"build-scss": "
|
|
30
|
+
"build": "yarn build-scss && yarn build-js && yarn build-class-references",
|
|
31
|
+
"build-scss": "sass --load-path=node_modules --embed-sources --style=compressed scss:build/css && postcss --use autoprefixer --replace 'build/css/**/*.css' --map",
|
|
32
32
|
"build:essential": "yarn run build-js && sass --load-path=node_modules --embed-sources --style=compressed scss/build.scss:build/css/build.css scss/docs:build/css/docs && postcss --use autoprefixer --replace 'build/css/**/*.css' --map",
|
|
33
33
|
"build-js": "mkdir -p build/js/modules && cp node_modules/@canonical/cookie-policy/build/js/cookie-policy.js build/js/modules && cp node_modules/@canonical/latest-news/dist/latest-news.js build/js/modules",
|
|
34
|
+
"build-class-references": "node scripts/create-class-references.js",
|
|
34
35
|
"serve": "./entrypoint 0.0.0.0:${PORT}",
|
|
35
36
|
"test-scss": "node -e 'require(\"./tests/parker\").parkerTest()'",
|
|
36
37
|
"test-spelling": "mdspell templates/docs/**/*.md -r -n -a --en-gb",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"percy": "percy exec -- node snapshots.js",
|
|
45
46
|
"icon-svgs-to-mixins": "node scripts/convert-svgs-to-icon-mixins.js icons"
|
|
46
47
|
},
|
|
47
|
-
"version": "3.
|
|
48
|
+
"version": "3.6.0",
|
|
48
49
|
"files": [
|
|
49
50
|
"_index.scss",
|
|
50
51
|
"/scss",
|
|
@@ -53,11 +54,13 @@
|
|
|
53
54
|
],
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"@canonical/cookie-policy": "3.4.0",
|
|
56
|
-
"@canonical/latest-news": "1.
|
|
57
|
-
"autoprefixer": "10.4.
|
|
58
|
-
"postcss": "8.4.
|
|
57
|
+
"@canonical/latest-news": "1.4.1",
|
|
58
|
+
"autoprefixer": "10.4.7",
|
|
59
|
+
"postcss": "8.4.14",
|
|
59
60
|
"postcss-cli": "9.1.0",
|
|
60
|
-
"
|
|
61
|
+
"postcss-scss": "4.0.4",
|
|
62
|
+
"sass": "1.52.2",
|
|
63
|
+
"yaml": "1.10.2"
|
|
61
64
|
},
|
|
62
65
|
"devDependencies": {
|
|
63
66
|
"@percy/script": "1.1.0",
|
|
@@ -65,7 +68,7 @@
|
|
|
65
68
|
"markdown-spellcheck": "1.3.1",
|
|
66
69
|
"parker": "0.0.10",
|
|
67
70
|
"prettier": "2.6.2",
|
|
68
|
-
"stylelint": "14.
|
|
71
|
+
"stylelint": "14.8.5",
|
|
69
72
|
"stylelint-config-prettier": "9.0.3",
|
|
70
73
|
"stylelint-config-recommended-scss": "5.0.2",
|
|
71
74
|
"stylelint-order": "5.0.0",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import 'settings';
|
|
2
|
+
|
|
3
|
+
@mixin vf-p-badge {
|
|
4
|
+
%vf-badge {
|
|
5
|
+
@extend %x-small-text;
|
|
6
|
+
background-color: $color-dark;
|
|
7
|
+
border-radius: 1rem;
|
|
8
|
+
box-sizing: content-box;
|
|
9
|
+
color: $color-x-light;
|
|
10
|
+
margin-bottom: 0;
|
|
11
|
+
max-width: 4ch;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
padding: 0 $spv--x-small;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.p-badge,
|
|
17
|
+
.p-badge--negative {
|
|
18
|
+
@extend %vf-badge;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.p-badge--negative {
|
|
22
|
+
background-color: $color-negative;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.p-chip,
|
|
26
|
+
[class*='p-chip--'] {
|
|
27
|
+
.p-badge,
|
|
28
|
+
.p-badge--negative {
|
|
29
|
+
align-self: center;
|
|
30
|
+
margin-left: $sph--small;
|
|
31
|
+
margin-right: -0.15rem;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,3 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
@classreference
|
|
3
|
+
code-snippet:
|
|
4
|
+
Root element:
|
|
5
|
+
.p-code-snippet:
|
|
6
|
+
Main element of the code snippet component.
|
|
7
|
+
"&.is-bordered":
|
|
8
|
+
Bordered variant, to be used when additional content (such as iframes) is used inside the code snippet component.
|
|
9
|
+
|
|
10
|
+
Code block:
|
|
11
|
+
.p-code-snippet__block:
|
|
12
|
+
Code block without any additonal styling elements.
|
|
13
|
+
"&.is-wrapped":
|
|
14
|
+
Code block with wrapped content in lines.
|
|
15
|
+
.p-code-snippet__block--icon:
|
|
16
|
+
Code block that starts with an icon. Default icon is a UNIX prompt. To be used with Linux CLI examples.
|
|
17
|
+
"&.is-windows-prompt":
|
|
18
|
+
Changes the `.p-code-snippet__block--icon` to use a Windows prompt icon. To be used with Windows CLI examples.
|
|
19
|
+
"&.is-url":
|
|
20
|
+
Changes the `.p-code-snippet__block--icon` to use a link icon. To be used with URLs.
|
|
21
|
+
.p-code-snippet__block--numbered:
|
|
22
|
+
Code block with numbered lines of code (to be used with longer pieces of code examples). Requires `.p-code-snippet__line`.
|
|
23
|
+
|
|
24
|
+
Code line:
|
|
25
|
+
.p-code-snippet__line:
|
|
26
|
+
A wrapper around single line of code. Needed with numbered variant of a code block.
|
|
27
|
+
|
|
28
|
+
Code block header:
|
|
29
|
+
.p-code-snippet__header:
|
|
30
|
+
A header of a code block. Contains a title and optional dropdowns.
|
|
31
|
+
"&.is-stacked":
|
|
32
|
+
A stacked version of a header (with a title displayed above the dropdowns). To be used when there are multiple dropdowns with a long title.
|
|
33
|
+
|
|
34
|
+
Code block title:
|
|
35
|
+
.p-code-snippet__title:
|
|
36
|
+
The title of a code block.
|
|
37
|
+
|
|
38
|
+
Dropdowns container:
|
|
39
|
+
.p-code-snippet__dropdowns:
|
|
40
|
+
The container element for any dropdowns in the header.
|
|
41
|
+
|
|
42
|
+
Dropdown:
|
|
43
|
+
.p-code-snippet__dropdown:
|
|
44
|
+
An individual dropdown in code block header.
|
|
45
|
+
*/
|
|
46
|
+
|
|
1
47
|
@import 'settings';
|
|
2
48
|
|
|
3
49
|
$color-snippet-heading-bg: rgba($color-x-dark, 0.08);
|
|
@@ -171,14 +171,14 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
|
|
|
171
171
|
|
|
172
172
|
.p-inline-list__item {
|
|
173
173
|
@include vf-inline-list-item;
|
|
174
|
-
|
|
174
|
+
margin-right: $sph--small;
|
|
175
175
|
position: relative;
|
|
176
176
|
|
|
177
177
|
&::after {
|
|
178
178
|
content: '\2022';
|
|
179
179
|
line-height: map-get($line-heights, default-text);
|
|
180
|
-
position:
|
|
181
|
-
right:
|
|
180
|
+
position: relative;
|
|
181
|
+
right: -0.25rem;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
&:last-of-type,
|
|
@@ -68,11 +68,13 @@ $spv-navigation-logo: 0.3125rem;
|
|
|
68
68
|
display: block;
|
|
69
69
|
font-weight: $font-weight-bold;
|
|
70
70
|
line-height: map-get($line-heights, default-text);
|
|
71
|
-
margin
|
|
71
|
+
margin: 0;
|
|
72
72
|
overflow: hidden;
|
|
73
73
|
position: relative;
|
|
74
|
+
text-align: left;
|
|
74
75
|
text-overflow: ellipsis;
|
|
75
76
|
white-space: nowrap;
|
|
77
|
+
width: 100%;
|
|
76
78
|
|
|
77
79
|
&::before {
|
|
78
80
|
content: '';
|
|
@@ -243,7 +245,7 @@ $spv-navigation-logo: 0.3125rem;
|
|
|
243
245
|
|
|
244
246
|
.p-navigation__logo-title {
|
|
245
247
|
@extend %vf-heading-4;
|
|
246
|
-
|
|
248
|
+
font-size: #{map-get($font-sizes, h4)}rem;
|
|
247
249
|
line-height: map-get($line-heights, x-small);
|
|
248
250
|
}
|
|
249
251
|
|
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
@import 'settings';
|
|
2
2
|
|
|
3
|
+
/*
|
|
4
|
+
@classreference
|
|
5
|
+
notification:
|
|
6
|
+
Root element:
|
|
7
|
+
.p-notification:
|
|
8
|
+
Notification in default variant. Same as `.p-notification--information`.
|
|
9
|
+
.p-notification--information:
|
|
10
|
+
Information notification. Same as default `.p-notification`.
|
|
11
|
+
.p-notification--positive:
|
|
12
|
+
Positive notification.
|
|
13
|
+
.p-notification--caution:
|
|
14
|
+
Caution notification.
|
|
15
|
+
.p-notification--negative:
|
|
16
|
+
Negative notification.
|
|
17
|
+
"&.is-borderless":
|
|
18
|
+
Borderless variant of notification. Used when notification is embeded into another container element.
|
|
19
|
+
"&.is-inline":
|
|
20
|
+
Inline version of notification with title and message rendered side by side.
|
|
21
|
+
|
|
22
|
+
Content container:
|
|
23
|
+
.p-notification__content:
|
|
24
|
+
Container element for notification content (title and message).
|
|
25
|
+
|
|
26
|
+
Title:
|
|
27
|
+
.p-notification__title:
|
|
28
|
+
The notification title.
|
|
29
|
+
|
|
30
|
+
Message:
|
|
31
|
+
.p-notification__message:
|
|
32
|
+
Text of the notification message.
|
|
33
|
+
|
|
34
|
+
Close button:
|
|
35
|
+
.p-notification__close:
|
|
36
|
+
The button to close the notification.
|
|
37
|
+
|
|
38
|
+
Meta-data container:
|
|
39
|
+
.p-notification__meta:
|
|
40
|
+
The container element for notification meta-data (timestamp and action buttons).
|
|
41
|
+
|
|
42
|
+
Timestamp:
|
|
43
|
+
.p-notification__timestamp:
|
|
44
|
+
Notification timestamp or date.
|
|
45
|
+
|
|
46
|
+
Actions container:
|
|
47
|
+
.p-notification__actions:
|
|
48
|
+
Container element for notification action buttons.
|
|
49
|
+
|
|
50
|
+
Action button:
|
|
51
|
+
.p-notification__action:
|
|
52
|
+
Single action button.
|
|
53
|
+
*/
|
|
54
|
+
|
|
3
55
|
// space on the left of the icon + icon width + space on the right of the icon
|
|
4
56
|
$notification-content-icon-space: 2 * $sph--large + map-get($icon-sizes, default);
|
|
5
57
|
|
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.p-pagination
|
|
16
|
+
// .p-pagination on the <ol> element is deprecated. It should be used on the wrapping <nav> element instead, and .p-pagination__items on the <ol> or <ul> element.
|
|
17
|
+
|
|
18
|
+
// stylelint-disable selector-max-type
|
|
19
|
+
.p-pagination:not(nav),
|
|
20
|
+
.p-pagination__items {
|
|
17
21
|
display: flex;
|
|
18
22
|
flex-direction: row;
|
|
19
23
|
list-style: none;
|
|
@@ -1,5 +1,81 @@
|
|
|
1
1
|
@import 'settings';
|
|
2
2
|
|
|
3
|
+
/*
|
|
4
|
+
@classreference
|
|
5
|
+
side-navigation:
|
|
6
|
+
Root element:
|
|
7
|
+
.p-side-navigation:
|
|
8
|
+
Side navigation in default variant.
|
|
9
|
+
.p-side-navigation--icons:
|
|
10
|
+
Side navigation with item icons.
|
|
11
|
+
.p-side-navigation--raw-html:
|
|
12
|
+
Raw HTML version of side navigation (used with links generated by an external service).
|
|
13
|
+
"&.is-drawer-expanded":
|
|
14
|
+
Set `.is-drawer-expanded` when side navigation drawer is open on small screens.
|
|
15
|
+
"&.is-drawer-collapsed":
|
|
16
|
+
Set `.is-drawer-collapsed` when side navigation drawer is closed on small screens.
|
|
17
|
+
"&.is-drawer-hidden":
|
|
18
|
+
Set `.is-drawer-hidden` when side navigation drawer is closed on small screens.
|
|
19
|
+
"&.is-sticky":
|
|
20
|
+
Sticky version of side navigation.
|
|
21
|
+
"&.is-dark":
|
|
22
|
+
Side navigation in dark theme (if default is light).
|
|
23
|
+
"&.is-light":
|
|
24
|
+
Side navigation in light theme (if default is dark).
|
|
25
|
+
|
|
26
|
+
Overlay:
|
|
27
|
+
.p-side-navigation__overlay:
|
|
28
|
+
Screen overlay to display when side navigation drawer is open on small screens.
|
|
29
|
+
|
|
30
|
+
Drawer:
|
|
31
|
+
.p-side-navigation__drawer:
|
|
32
|
+
Side navigation drawer (to allow expanding and collapsing the navigation on small screens).
|
|
33
|
+
|
|
34
|
+
Drawer header:
|
|
35
|
+
.p-side-navigation__drawer-header:
|
|
36
|
+
Header of the side navigation drawer.
|
|
37
|
+
|
|
38
|
+
Toggle button:
|
|
39
|
+
.p-side-navigation__toggle:
|
|
40
|
+
Side navigation toggle button (to open side navigation on small screens).
|
|
41
|
+
.p-side-navigation__toggle--in-drawer:
|
|
42
|
+
Side navigation toggle button in drawer (to close navigation on small screens).
|
|
43
|
+
|
|
44
|
+
Items list heading:
|
|
45
|
+
.p-side-navigation__heading:
|
|
46
|
+
Heading for side navigation items group (text only).
|
|
47
|
+
.p-side-navigation__heading--linked:
|
|
48
|
+
Heading for side navigation items group that contains a link (`.p-side-navigation__link`).
|
|
49
|
+
|
|
50
|
+
Items list:
|
|
51
|
+
.p-side-navigation__list:
|
|
52
|
+
Group of side navigation items (usually a `<ul>` element).
|
|
53
|
+
|
|
54
|
+
Item element:
|
|
55
|
+
.p-side-navigation__item:
|
|
56
|
+
Single item in side navigation (usually a `<li>` element). May contain nested items lists.
|
|
57
|
+
.p-side-navigation__item--title:
|
|
58
|
+
Single title item in side navigation (usually a `<li>` element).
|
|
59
|
+
"&.has-active-child":
|
|
60
|
+
Set `.has-active-child` on a item that contains an active nested item. This is used in collapsible side navigation in application layout.
|
|
61
|
+
|
|
62
|
+
Item link:
|
|
63
|
+
.p-side-navigation__link:
|
|
64
|
+
Single link in the side navigation.
|
|
65
|
+
|
|
66
|
+
Item text:
|
|
67
|
+
.p-side-navigation__text:
|
|
68
|
+
Single text item in side navigation (for items that are not linked).
|
|
69
|
+
|
|
70
|
+
Item icon:
|
|
71
|
+
.p-side-navigation__icon:
|
|
72
|
+
An icon in side navigation item (used with `.p-side-navigation--icons` variant).
|
|
73
|
+
|
|
74
|
+
Item status:
|
|
75
|
+
.p-side-navigation__status:
|
|
76
|
+
A container for status icon or label inside the navigation item.
|
|
77
|
+
*/
|
|
78
|
+
|
|
3
79
|
@mixin vf-p-side-navigation {
|
|
4
80
|
// STYLING OF SIDE NAVIGATION RESPONSIVE DRAWER
|
|
5
81
|
|
|
@@ -206,6 +282,18 @@
|
|
|
206
282
|
padding-top: $spv--x-small;
|
|
207
283
|
}
|
|
208
284
|
|
|
285
|
+
%side-navigation__heading {
|
|
286
|
+
@extend %side-navigation__text;
|
|
287
|
+
|
|
288
|
+
// reset heading styles
|
|
289
|
+
@extend %common-default-text-properties;
|
|
290
|
+
@extend %bold;
|
|
291
|
+
|
|
292
|
+
display: block;
|
|
293
|
+
font-size: map-get($base-font-sizes, base);
|
|
294
|
+
margin: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
209
297
|
%side-navigation__link {
|
|
210
298
|
@include vf-focus;
|
|
211
299
|
|
|
@@ -230,6 +318,7 @@
|
|
|
230
318
|
@extend %side-navigation__link;
|
|
231
319
|
}
|
|
232
320
|
|
|
321
|
+
.p-side-navigation__heading,
|
|
233
322
|
.p-side-navigation__text,
|
|
234
323
|
.p-side-navigation__link {
|
|
235
324
|
@extend %side-navigation__text;
|
|
@@ -275,6 +364,15 @@
|
|
|
275
364
|
padding-left: $spv--small;
|
|
276
365
|
}
|
|
277
366
|
|
|
367
|
+
.p-side-navigation__heading,
|
|
368
|
+
.p-side-navigation__heading--linked {
|
|
369
|
+
@extend %side-navigation__heading;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.p-side-navigation__heading--linked {
|
|
373
|
+
padding: 0; // padding will come from the link in heading
|
|
374
|
+
}
|
|
375
|
+
|
|
278
376
|
// Styles for markup in raw HTML docs variant
|
|
279
377
|
.p-side-navigation--raw-html {
|
|
280
378
|
// stylelint-disable selector-max-type -- we support raw HTML markup for discourse-generated side nav
|
|
@@ -283,14 +381,7 @@
|
|
|
283
381
|
h4,
|
|
284
382
|
h5,
|
|
285
383
|
h6 {
|
|
286
|
-
@extend %side-
|
|
287
|
-
|
|
288
|
-
// reset heading styles
|
|
289
|
-
@extend %common-default-text-properties;
|
|
290
|
-
@extend %bold;
|
|
291
|
-
|
|
292
|
-
font-size: map-get($base-font-sizes, base);
|
|
293
|
-
margin: 0;
|
|
384
|
+
@extend %side-navigation__heading;
|
|
294
385
|
}
|
|
295
386
|
|
|
296
387
|
ul {
|
|
@@ -488,6 +579,8 @@
|
|
|
488
579
|
}
|
|
489
580
|
}
|
|
490
581
|
|
|
582
|
+
.p-side-navigation__heading,
|
|
583
|
+
.p-side-navigation__heading--linked .p-side-navigation__link,
|
|
491
584
|
.p-side-navigation__item--title,
|
|
492
585
|
.p-side-navigation__item--title .p-side-navigation__link {
|
|
493
586
|
color: $color-sidenav-text-active;
|
package/scss/_patterns_tabs.scss
CHANGED
|
@@ -42,9 +42,12 @@
|
|
|
42
42
|
);
|
|
43
43
|
@include vf-highlight-bar(transparent, bottom, false);
|
|
44
44
|
|
|
45
|
+
align-items: center;
|
|
45
46
|
border: none;
|
|
46
47
|
color: $color-dark;
|
|
47
|
-
display:
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: $sph--small;
|
|
50
|
+
height: 100%;
|
|
48
51
|
line-height: map-get($line-heights, default-text);
|
|
49
52
|
margin-bottom: 0;
|
|
50
53
|
padding: $spv--medium $sph--large;
|
package/scss/_vanilla.scss
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
@import 'patterns_buttons';
|
|
9
9
|
@import 'patterns_card';
|
|
10
10
|
@import 'patterns_chip';
|
|
11
|
+
@import 'patterns_badge';
|
|
11
12
|
@import 'patterns_code-snippet';
|
|
12
13
|
@import 'patterns_contextual-menu';
|
|
13
14
|
@import 'patterns_divider';
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
@include vf-p-buttons;
|
|
89
90
|
@include vf-p-card;
|
|
90
91
|
@include vf-p-chip;
|
|
92
|
+
@include vf-p-badge;
|
|
91
93
|
@include vf-p-code-snippet;
|
|
92
94
|
@include vf-p-contextual-menu;
|
|
93
95
|
@include vf-p-divider;
|