vanilla-framework 3.3.0 → 3.4.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
@@ -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": "yarn run build-js && sass --load-path=node_modules --embed-sources --style=compressed scss:build/css && postcss --use autoprefixer --replace 'build/css/**/*.css' --map",
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.3.0",
48
+ "version": "3.4.0",
48
49
  "files": [
49
50
  "_index.scss",
50
51
  "/scss",
@@ -54,10 +55,12 @@
54
55
  "dependencies": {
55
56
  "@canonical/cookie-policy": "3.4.0",
56
57
  "@canonical/latest-news": "1.3.0",
57
- "autoprefixer": "10.4.4",
58
- "postcss": "8.4.12",
58
+ "autoprefixer": "10.4.7",
59
+ "postcss": "8.4.13",
59
60
  "postcss-cli": "9.1.0",
60
- "sass": "1.49.11"
61
+ "postcss-scss": "4.0.3",
62
+ "sass": "1.51.0",
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.6.1",
71
+ "stylelint": "14.8.2",
69
72
  "stylelint-config-prettier": "9.0.3",
70
73
  "stylelint-config-recommended-scss": "5.0.2",
71
74
  "stylelint-order": "5.0.0",
@@ -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);
@@ -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-bottom: 0;
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: '';
@@ -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,75 @@
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:
45
+ .p-side-navigation__list:
46
+ Group of side navigation items (usually a `<ul>` element).
47
+
48
+ Item element:
49
+ .p-side-navigation__item:
50
+ Single item in side navigation (usually a `<li>` element). May contain nested items lists.
51
+ .p-side-navigation__item--title:
52
+ Single title item in side navigation (usually a `<li>` element).
53
+ "&.has-active-child":
54
+ Set `.has-active-child` on a item that contains an active nested item. This is used in collapsible side navigation in application layout.
55
+
56
+ Item link:
57
+ .p-side-navigation__link:
58
+ Single link in the side navigation.
59
+
60
+ Item text:
61
+ .p-side-navigation__text:
62
+ Single text item in side navigation (for items that are not linked).
63
+
64
+ Item icon:
65
+ .p-side-navigation__icon:
66
+ An icon in side navigation item (used with `.p-side-navigation--icons` variant).
67
+
68
+ Item status:
69
+ .p-side-navigation__status:
70
+ A container for status icon or label inside the navigation item.
71
+ */
72
+
3
73
  @mixin vf-p-side-navigation {
4
74
  // STYLING OF SIDE NAVIGATION RESPONSIVE DRAWER
5
75