vanilla-framework 3.1.1 → 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.1.1",
48
+ "version": "3.4.0",
48
49
  "files": [
49
50
  "_index.scss",
50
51
  "/scss",
@@ -54,18 +55,20 @@
54
55
  "dependencies": {
55
56
  "@canonical/cookie-policy": "3.4.0",
56
57
  "@canonical/latest-news": "1.3.0",
57
- "autoprefixer": "10.4.2",
58
- "postcss": "8.4.6",
58
+ "autoprefixer": "10.4.7",
59
+ "postcss": "8.4.13",
59
60
  "postcss-cli": "9.1.0",
60
- "sass": "1.49.7"
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",
64
67
  "get-site-urls": "1.1.7",
65
68
  "markdown-spellcheck": "1.3.1",
66
69
  "parker": "0.0.10",
67
- "prettier": "2.5.1",
68
- "stylelint": "14.3.0",
70
+ "prettier": "2.6.2",
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",
@@ -16,48 +16,45 @@
16
16
  }
17
17
 
18
18
  .p-accordion__tab {
19
- // calculate icon top position based on top padding (from %single-border-text-vpadding--scaling)
20
- // and offset to align it with baseline of accordion tab text element
21
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, default-text) - $icon-size) * 0.5});
22
-
23
19
  @extend %single-border-text-vpadding--scaling;
24
20
  @include vf-focus;
25
21
 
26
- background: {
27
- color: inherit;
28
- position: top $icon-top-position left $sph--large;
29
- repeat: no-repeat;
30
- }
31
-
22
+ background-color: inherit;
32
23
  border: 0;
33
24
  border-radius: 0;
34
25
  font-size: inherit;
35
26
  justify-content: flex-start;
36
27
  margin-bottom: 0;
37
- padding-left: $sph--large + $icon-size + $sph--large;
38
28
  padding-right: $sph--large;
29
+ position: relative;
39
30
  text-align: left;
40
31
  transition-duration: 0s;
41
32
  width: 100%;
42
33
  z-index: 2;
43
34
 
35
+ &::before {
36
+ @include vf-icon-chevron($color-mid-dark);
37
+ @include vf-animation($property: transform, $duration: fast);
38
+ @extend %icon;
39
+
40
+ content: '';
41
+ margin-right: $sph--large;
42
+ }
43
+
44
44
  // aria-selected controls the open and closed state for the accordion tab
45
45
  &[aria-expanded='true'] {
46
- @include vf-icon-minus($color-mid-dark);
47
-
48
46
  // override base expanded button styles
49
47
  background-color: inherit;
48
+
50
49
  &:hover {
51
50
  background-color: $colors--light-theme--background-hover;
52
51
  }
53
-
54
- background-size: $icon-size;
55
52
  }
56
53
 
57
54
  &[aria-expanded='false'] {
58
- @include vf-icon-plus($color-mid-dark);
59
-
60
- background-size: $icon-size;
55
+ &::before {
56
+ transform: rotate(-90deg);
57
+ }
61
58
  }
62
59
  }
63
60
 
@@ -74,25 +71,17 @@
74
71
  }
75
72
 
76
73
  // stylelint-disable selector-max-type
77
- h2.p-accordion__heading > .p-accordion__tab,
78
- .p-heading--2 > .p-accordion__tab {
79
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, h2) - $icon-size) * 0.5});
80
-
81
- background-position-y: $icon-top-position;
74
+ .p-heading--2 > .p-accordion__tab::before,
75
+ h2.p-accordion__heading > .p-accordion__tab::before {
76
+ @include vf-icon-size($x-height);
77
+ vertical-align: 0;
82
78
  }
83
79
 
84
- h3.p-accordion__heading > .p-accordion__tab,
85
- .p-heading--3 > .p-accordion__tab {
86
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, h3) - $icon-size) * 0.5});
87
-
88
- background-position-y: $icon-top-position;
89
- }
90
-
91
- h4.p-accordion__heading > .p-accordion__tab,
92
- .p-heading--4 > .p-accordion__tab {
93
- $icon-top-position: calc(#{$table-cell-vertical-padding + (map-get($line-heights, h4) - $icon-size) * 0.5});
94
-
95
- background-position-y: $icon-top-position;
80
+ .p-heading--3 > .p-accordion__tab::before,
81
+ .p-heading--4 > .p-accordion__tab::before,
82
+ h3.p-accordion__heading > .p-accordion__tab::before,
83
+ h4.p-accordion__heading > .p-accordion__tab::before {
84
+ vertical-align: 0;
96
85
  }
97
86
  // stylelint-enable selector-max-type
98
87
 
@@ -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);
@@ -40,10 +86,10 @@ $code-snippet-header-v-spacing: $spv--small;
40
86
 
41
87
  .p-code-snippet__block--numbered {
42
88
  counter-reset: line-numbering;
43
- }
44
89
 
45
- .p-code-snippet__line {
46
- @extend %code-numbered-line;
90
+ .p-code-snippet__line {
91
+ @extend %code-numbered-line;
92
+ }
47
93
  }
48
94
 
49
95
  .p-code-snippet__header {
@@ -1,12 +1,25 @@
1
1
  @import 'settings';
2
2
 
3
3
  $lightness-threshold: 70;
4
+ $navigation-logo-tag-width: 1.5rem;
5
+ $navigation-logo-tag-height: 2.2rem;
6
+ $navigation-logo-tag-height-desktop: 2.4rem;
7
+ $navigation-logo-height: 3rem;
8
+ $navigation-logo-height-desktop: 3.5rem;
9
+ $navigation-logo-width: 1.1rem;
10
+ $sph-navigation-link: 0.3rem;
11
+ $spv-navigation-logo: 0.3125rem;
4
12
 
5
13
  @mixin vf-p-navigation {
6
14
  // placeholders
7
15
  %navigation-link-responsive-padding-vertical {
8
- padding-bottom: $spv--large;
9
- padding-top: $spv--large;
16
+ padding-bottom: $spv--medium;
17
+ padding-top: $spv--medium;
18
+
19
+ @media (min-width: $breakpoint-navigation-threshold) {
20
+ padding-bottom: $spv--large;
21
+ padding-top: $spv--large;
22
+ }
10
23
  }
11
24
 
12
25
  %navigation-link-responsive-padding-left {
@@ -47,14 +60,21 @@ $lightness-threshold: 70;
47
60
  @include vf-animation($properties, snap);
48
61
  @include vf-focus;
49
62
 
63
+ // override button styles
64
+ background-color: transparent;
65
+ border: none;
66
+ border-radius: 0;
67
+
50
68
  display: block;
51
69
  font-weight: $font-weight-bold;
52
70
  line-height: map-get($line-heights, default-text);
53
- margin-bottom: 0;
71
+ margin: 0;
54
72
  overflow: hidden;
55
73
  position: relative;
74
+ text-align: left;
56
75
  text-overflow: ellipsis;
57
76
  white-space: nowrap;
77
+ width: 100%;
58
78
 
59
79
  &::before {
60
80
  content: '';
@@ -179,12 +199,17 @@ $lightness-threshold: 70;
179
199
  }
180
200
  }
181
201
 
202
+ // Styles for old navigation logo
182
203
  .p-navigation__logo {
183
204
  display: flex;
184
205
  flex: 0 0 auto;
185
- height: 3.5rem;
206
+ height: $navigation-logo-height;
186
207
  margin: 0 $sph--large 0 0;
187
208
 
209
+ @media (min-width: $breakpoint-navigation-threshold) {
210
+ height: $navigation-logo-height-desktop;
211
+ }
212
+
188
213
  .p-navigation__item {
189
214
  @include vf-focus;
190
215
 
@@ -192,6 +217,53 @@ $lightness-threshold: 70;
192
217
  }
193
218
  }
194
219
 
220
+ .p-navigation__tagged-logo {
221
+ display: flex; // to prevent logo link from expanding full width
222
+ margin-right: 0;
223
+ min-width: 13rem;
224
+
225
+ .p-navigation__logo-tag {
226
+ background-color: $color-accent;
227
+ height: $navigation-logo-tag-height;
228
+ left: 0;
229
+ position: absolute;
230
+ top: 0;
231
+ width: $navigation-logo-tag-width;
232
+
233
+ @media (min-width: $breakpoint-navigation-threshold) {
234
+ height: $navigation-logo-tag-height-desktop;
235
+ }
236
+ }
237
+
238
+ .p-navigation__logo-icon {
239
+ bottom: $spv-navigation-logo;
240
+ left: 50%;
241
+ position: absolute;
242
+ transform: translate(-50%, 0);
243
+ width: $navigation-logo-width;
244
+ }
245
+
246
+ .p-navigation__logo-title {
247
+ @extend %vf-heading-4;
248
+
249
+ line-height: map-get($line-heights, x-small);
250
+ }
251
+
252
+ .p-navigation__link {
253
+ @extend %navigation-link;
254
+
255
+ padding-left: $navigation-logo-tag-width + $sph-navigation-link;
256
+
257
+ &:hover {
258
+ background-color: transparent !important;
259
+ }
260
+
261
+ &::before {
262
+ content: none;
263
+ }
264
+ }
265
+ }
266
+
195
267
  .p-navigation__image {
196
268
  align-self: center;
197
269
  max-height: 2rem;
@@ -199,6 +271,19 @@ $lightness-threshold: 70;
199
271
  }
200
272
 
201
273
  // navigation items
274
+ .p-navigation__items {
275
+ display: none; // hidden by default on mobile (expands is a dropdown)
276
+ list-style: none;
277
+ margin: -1px 0 0 0;
278
+ padding: 0;
279
+
280
+ @media (min-width: $breakpoint-navigation-threshold) {
281
+ display: flex;
282
+ flex-wrap: wrap;
283
+ margin-top: 0; // prevents bottom border of nav from moving 1px
284
+ }
285
+ }
286
+
202
287
  .p-navigation__nav {
203
288
  display: none;
204
289
  flex-direction: column;
@@ -212,15 +297,14 @@ $lightness-threshold: 70;
212
297
  }
213
298
  }
214
299
 
215
- .p-navigation__items {
216
- list-style: none;
217
- margin: -1px 0 0 0;
218
- padding: 0;
300
+ // items inside the logo banner (for mobile menu)
301
+ .p-navigation__banner .p-navigation__items {
302
+ display: flex;
303
+ flex-wrap: wrap;
304
+ margin-top: 0; // prevents bottom border of nav from moving 1px
219
305
 
220
306
  @media (min-width: $breakpoint-navigation-threshold) {
221
- display: flex;
222
- flex-wrap: wrap;
223
- margin-top: 0; // prevents bottom border of nav from moving 1px
307
+ display: none;
224
308
  }
225
309
  }
226
310
 
@@ -229,7 +313,8 @@ $lightness-threshold: 70;
229
313
  display: none;
230
314
  }
231
315
 
232
- .p-navigation__toggle--open {
316
+ .p-navigation__toggle--open,
317
+ .p-navigation__toggle--search {
233
318
  display: block;
234
319
 
235
320
  @media (min-width: $breakpoint-navigation-threshold) {
@@ -238,7 +323,8 @@ $lightness-threshold: 70;
238
323
  }
239
324
 
240
325
  .p-navigation__toggle--open,
241
- .p-navigation__toggle--close {
326
+ .p-navigation__toggle--close,
327
+ .p-navigation__toggle--search {
242
328
  @extend %navigation-link-responsive-padding-horizontal;
243
329
  @extend %navigation-link-responsive-padding-vertical;
244
330
  @include vf-focus;
@@ -262,6 +348,14 @@ $lightness-threshold: 70;
262
348
  display: flex;
263
349
  }
264
350
 
351
+ .p-navigation__items {
352
+ display: block;
353
+
354
+ @media (min-width: $breakpoint-navigation-threshold) {
355
+ display: flex;
356
+ }
357
+ }
358
+
265
359
  .p-navigation__toggle--open {
266
360
  display: none;
267
361
  }
@@ -279,6 +373,7 @@ $lightness-threshold: 70;
279
373
 
280
374
  // on mobile screens search box is visible inside of the mobile navigation dropdown
281
375
  .p-navigation__search {
376
+ display: none;
282
377
  padding-top: $spv--large;
283
378
 
284
379
  // allow search box to take full width
@@ -287,64 +382,59 @@ $lightness-threshold: 70;
287
382
  }
288
383
  }
289
384
 
290
- // on mobile screens both search toggle and overlay are not used and hidden from view
291
385
  .p-navigation__link--search-toggle {
292
386
  @extend %navigation-link;
293
387
 
294
- display: none;
388
+ display: block;
295
389
  height: 100%; // keep the height of the navigation when 'Search' label is hidden
296
390
  padding-left: 0; // on small screens label is hidden, so we remove left padding as well
297
391
  padding-right: 2 * $sph--small + map-get($icon-sizes, default);
298
392
  position: relative;
299
- }
300
393
 
301
- .p-navigation__search-overlay {
302
- display: none;
303
- }
394
+ // hide "search" label on small screens (only show the icon)
395
+ .p-navigation__search-label {
396
+ display: none;
397
+ }
304
398
 
305
- // the expanding search box is only visible on large screens in navigation bar
306
- @media (min-width: $breakpoint-navigation-threshold) {
307
- .p-navigation__link--search-toggle {
308
- display: block;
399
+ // show both label and icon on large screens
400
+ @media (min-width: $breakpoint-large) {
401
+ padding-left: $sph--large;
309
402
 
310
- // hide "search" label on small screens (only show the icon)
311
403
  .p-navigation__search-label {
312
- display: none;
404
+ display: initial;
313
405
  }
406
+ }
314
407
 
315
- // show both label and icon on large screens
316
- @media (min-width: $breakpoint-large) {
317
- padding-left: $sph--large;
318
-
319
- .p-navigation__search-label {
320
- display: initial;
321
- }
322
- }
408
+ &::after {
409
+ background-position: center;
410
+ background-repeat: no-repeat;
411
+ background-size: contain;
412
+ content: '';
413
+ display: block;
414
+ height: $spv--large;
415
+ pointer-events: none;
416
+ position: absolute;
417
+ right: calc(#{$sph--small} + 1px); // 1px for the border on selects. this aligns it with any selects underneath
418
+ text-indent: calc(100% + 10rem);
419
+ top: calc(#{$spv--medium} + #{map-get($nudges, x-small)});
420
+ width: map-get($icon-sizes, default);
323
421
 
324
- &::after {
325
- background-position: center;
326
- background-repeat: no-repeat;
327
- background-size: contain;
328
- content: '';
329
- display: block;
330
- height: $spv--large;
331
- pointer-events: none;
332
- position: absolute;
333
- right: map-get($grid-margin-widths, small);
334
- text-indent: calc(100% + 10rem);
422
+ @media (min-width: $breakpoint-navigation-threshold) {
335
423
  top: calc(#{$spv--large} + #{map-get($nudges, x-small)});
336
- width: map-get($icon-sizes, default);
424
+ }
425
+ }
426
+ }
337
427
 
338
- @media (min-width: $threshold-4-6-col) {
339
- right: map-get($grid-margin-widths, default);
340
- }
428
+ .p-navigation__nav .p-navigation__link--search-toggle {
429
+ display: none;
341
430
 
342
- @media (min-width: $breakpoint-navigation-threshold) {
343
- right: calc(#{$sph--small} + 1px); // 1px for the border on selects. this aligns it with any selects underneath
344
- }
345
- }
431
+ @media (min-width: $breakpoint-navigation-threshold) {
432
+ display: block;
346
433
  }
434
+ }
347
435
 
436
+ // the expanding search box is only visible on large screens in navigation bar
437
+ @media (min-width: $breakpoint-navigation-threshold) {
348
438
  .p-navigation__search {
349
439
  align-items: center;
350
440
  display: none;
@@ -356,7 +446,6 @@ $lightness-threshold: 70;
356
446
  @include vf-animation(opacity, snap);
357
447
 
358
448
  background-color: $colors--light-theme--background-overlay;
359
- bottom: 0;
360
449
  display: block;
361
450
  height: 100%;
362
451
  left: 0;
@@ -368,30 +457,51 @@ $lightness-threshold: 70;
368
457
  width: 100%;
369
458
  z-index: 59;
370
459
  }
460
+ }
371
461
 
372
- // when navigation search is expanded
373
- .p-navigation.has-search-open {
374
- // hide all navigation items (including search toggle)
375
- .p-navigation__items {
376
- display: none;
377
- }
462
+ // when navigation search is expanded
463
+ .p-navigation.has-search-open {
464
+ // make sure search in navigation renders on top of the overlay
465
+ .p-navigation__nav {
466
+ display: flex;
467
+ z-index: 60;
468
+ }
378
469
 
379
- // show expanded search box
380
- .p-navigation__search {
381
- display: flex;
382
- }
470
+ // hide all navigation items (including search toggle)
471
+ .p-navigation__nav .p-navigation__items {
472
+ display: none;
473
+ }
383
474
 
384
- // fade in search overlay
385
- .p-navigation__search-overlay {
386
- opacity: 0.5;
387
- pointer-events: all;
388
- }
475
+ // show expanded search box
476
+ .p-navigation__search {
477
+ display: flex;
478
+ }
389
479
 
390
- // make sure search in navigation renders on top of the overlay
391
- .p-navigation__nav {
392
- z-index: 60;
480
+ // fade in search overlay
481
+ .p-navigation__search-overlay {
482
+ opacity: 0.5;
483
+ pointer-events: all;
484
+ }
485
+ }
486
+
487
+ .p-navigation.has-menu-open {
488
+ // hide all navigation items (including search toggle)
489
+ .p-navigation__nav {
490
+ display: flex;
491
+ }
492
+
493
+ .p-navigation__nav .p-navigation__items {
494
+ display: block;
495
+
496
+ @media (min-width: $breakpoint-navigation-threshold) {
497
+ display: flex;
393
498
  }
394
499
  }
500
+
501
+ // show expanded search box
502
+ .p-navigation__search {
503
+ display: none;
504
+ }
395
505
  }
396
506
 
397
507
  // DROPDOWNS
@@ -412,7 +522,7 @@ $lightness-threshold: 70;
412
522
  top: $spv--large * 2 + map-get($line-heights, default-text);
413
523
  }
414
524
 
415
- @media (max-width: $breakpoint-navigation-threshold - 1) {
525
+ @media (max-width: ($breakpoint-navigation-threshold - 1)) {
416
526
  box-shadow: none;
417
527
  }
418
528
  }
@@ -537,11 +647,16 @@ $lightness-threshold: 70;
537
647
  background-color: $color-navigation-background--hover;
538
648
  }
539
649
 
650
+ &[aria-pressed='true'],
540
651
  &:active {
541
652
  background-color: $color-navigation-background--active;
542
653
  }
543
654
  }
544
655
 
656
+ .p-navigation__logo-title {
657
+ color: $color-navigation-text;
658
+ }
659
+
545
660
  .p-navigation__item--dropdown-toggle {
546
661
  &::after {
547
662
  @include vf-icon-chevron($color-navigation-icon);
@@ -552,6 +667,7 @@ $lightness-threshold: 70;
552
667
  }
553
668
  }
554
669
 
670
+ .p-navigation__toggle--search::after,
555
671
  .p-navigation__item .p-navigation__link--search-toggle::after {
556
672
  @include vf-icon-search($color-navigation-icon);
557
673
  }
@@ -571,9 +687,19 @@ $lightness-threshold: 70;
571
687
  }
572
688
  }
573
689
 
574
- .p-navigation__link::before {
690
+ .p-navigation__nav .p-navigation__link::before {
575
691
  background: $color-navigation-separator;
576
692
  }
693
+
694
+ // on mobile expanded nav needs to match pressed color of the buttons
695
+ &.has-menu-open .p-navigation__nav,
696
+ &.has-search-open .p-navigation__nav {
697
+ background-color: $color-navigation-background--active;
698
+
699
+ @media (min-width: $breakpoint-navigation-threshold) {
700
+ background-color: transparent;
701
+ }
702
+ }
577
703
  }
578
704
 
579
705
  @mixin vf-navigation-light-theme {
@@ -582,9 +708,9 @@ $lightness-threshold: 70;
582
708
  $color-navigation-background: $colors--light-theme--background-default,
583
709
  $color-navigation-background--hover: $colors--light-theme--background-alt,
584
710
  $color-navigation-background--active: $colors--light-theme--background-active,
585
- $color-navigation-highlight: $color-accent,
711
+ $color-navigation-highlight: $colors--light-theme--text-default,
586
712
  $color-navigation-separator: $colors--light-theme--border-low-contrast,
587
- $color-navigation-icon: $colors--light-theme--text-muted
713
+ $color-navigation-icon: $colors--light-theme--text-default
588
714
  );
589
715
  }
590
716
 
@@ -594,8 +720,8 @@ $lightness-threshold: 70;
594
720
  $color-navigation-background: $colors--dark-theme--background-default,
595
721
  $color-navigation-background--hover: $colors--dark-theme--background-hover,
596
722
  $color-navigation-background--active: $colors--dark-theme--background-active,
597
- $color-navigation-highlight: $color-accent,
723
+ $color-navigation-highlight: $colors--dark-theme--text-default,
598
724
  $color-navigation-separator: $colors--dark-theme--border-low-contrast,
599
- $color-navigation-icon: $colors--dark-theme--text-muted
725
+ $color-navigation-icon: $colors--dark-theme--text-default
600
726
  );
601
727
  }
@@ -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,9 +1,14 @@
1
- @mixin vf-p-tab-buttons {
1
+ @mixin vf-p-segmented-control {
2
+ .p-segmented-control,
3
+ // p-tab-buttons is deprecated,
4
+ // please use p-segmented-control instead
2
5
  .p-tab-buttons {
6
+ .p-segmented-control__list,
3
7
  .p-tab-buttons__list {
4
8
  display: flex;
5
9
  }
6
10
 
11
+ .p-segmented-control__button,
7
12
  .p-tab-buttons__button {
8
13
  @extend %vf-button-has-icon;
9
14
 
@@ -41,8 +46,14 @@
41
46
  }
42
47
  }
43
48
 
49
+ &.is-dense .p-segmented-control__button,
44
50
  &.is-dense .p-tab-buttons__button {
45
51
  @extend %vf-button-dense-vertical-padding;
46
52
  }
47
53
  }
48
54
  }
55
+
56
+ // Deprecated mixin kept for compatibility
57
+ @mixin vf-p-tab-buttons {
58
+ @include vf-p-segmented-control;
59
+ }
@@ -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
 
@@ -35,8 +105,11 @@
35
105
 
36
106
  .p-side-navigation:target &,
37
107
  [class*='p-side-navigation--']:target &,
108
+ // is-expanded and is-collapsed are deprecated and replaced by is-drawer-expanded and is-drawer-collapsed
38
109
  .p-side-navigation.is-expanded &,
39
- [class*='p-side-navigation--'].is-expanded & {
110
+ .p-side-navigation.is-drawer-expanded &,
111
+ [class*='p-side-navigation--'].is-expanded &,
112
+ [class*='p-side-navigation--'].is-drawer-expanded & {
40
113
  @extend %vf-has-box-shadow;
41
114
 
42
115
  animation: vf-p-side-navigation-expand map-get($animation-duration, brisk);
@@ -44,10 +117,20 @@
44
117
  }
45
118
 
46
119
  .p-side-navigation.is-collapsed &,
47
- [class*='p-side-navigation--'].is-collapsed & {
120
+ .p-side-navigation.is-drawer-collapsed &,
121
+ [class*='p-side-navigation--'].is-collapsed &,
122
+ [class*='p-side-navigation--'].is-drawer-collapsed & {
48
123
  animation: vf-p-side-navigation-collapse map-get($animation-duration, brisk);
49
124
  }
50
125
 
126
+ .p-side-navigation.is-drawer-hidden &,
127
+ [class*='p-side-navigation--'].is-drawer-hidden & {
128
+ display: none;
129
+ @media (min-width: $threshold-6-12-col) {
130
+ display: block;
131
+ }
132
+ }
133
+
51
134
  @media (min-width: $breakpoint-x-small) {
52
135
  max-width: 20rem;
53
136
  }
@@ -68,7 +151,9 @@
68
151
  .p-side-navigation:target &,
69
152
  [class*='p-side-navigation--']:target &,
70
153
  .p-side-navigation.is-expanded &,
71
- [class*='p-side-navigation--'].is-expanded & {
154
+ .p-side-navigation.is-drawer-expanded &,
155
+ [class*='p-side-navigation--'].is-expanded &,
156
+ [class*='p-side-navigation--'].is-drawer-expanded & {
72
157
  opacity: 1;
73
158
  pointer-events: all;
74
159
  }
@@ -134,7 +219,9 @@
134
219
  .p-side-navigation:target .p-side-navigation__drawer,
135
220
  [class*='p-side-navigation--']:target .p-side-navigation__drawer,
136
221
  .p-side-navigation.is-expanded .p-side-navigation__drawer,
137
- [class*='p-side-navigation--'].is-expanded .p-side-navigation__drawer {
222
+ .p-side-navigation.is-drawer-expanded .p-side-navigation__drawer,
223
+ [class*='p-side-navigation--'].is-expanded .p-side-navigation__drawer,
224
+ [class*='p-side-navigation--'].is-drawer-expanded .p-side-navigation__drawer {
138
225
  box-shadow: none;
139
226
  display: block;
140
227
  max-width: none;
@@ -416,6 +503,15 @@
416
503
  &::before {
417
504
  @include vf-icon-chevron($color-sidenav-toggle-icon);
418
505
  }
506
+
507
+ &[aria-expanded='true'] {
508
+ background-color: $color-transparent;
509
+
510
+ &:hover {
511
+ background: $color-sidenav-item-background-hover;
512
+ color: $color-sidenav-text-active;
513
+ }
514
+ }
419
515
  }
420
516
 
421
517
  .p-side-navigation__drawer {
@@ -1,8 +1,8 @@
1
1
  @import 'settings';
2
2
 
3
- // Default label styling
4
- @mixin vf-p-label {
5
- %vf-label {
3
+ // Default status label styling
4
+ @mixin vf-p-status-label {
5
+ %vf-status-label {
6
6
  @extend %x-small-text;
7
7
  @extend %u-no-margin--bottom--small;
8
8
 
@@ -15,38 +15,48 @@
15
15
  white-space: nowrap;
16
16
  }
17
17
 
18
+ .p-status-label,
18
19
  .p-label {
19
- @extend %vf-label;
20
+ @extend %vf-status-label;
20
21
 
21
22
  background-color: $color-mid-dark;
22
23
  color: $color-x-light;
23
24
  }
24
25
 
26
+ .p-status-label--positive,
25
27
  .p-label--positive {
26
- @extend %vf-label;
28
+ @extend %vf-status-label;
27
29
 
28
30
  background-color: $color-positive;
29
31
  color: $color-x-light;
30
32
  }
31
33
 
34
+ .p-status-label--caution,
32
35
  .p-label--caution {
33
- @extend %vf-label;
36
+ @extend %vf-status-label;
34
37
 
35
38
  background-color: $color-caution;
36
39
  color: $color-dark;
37
40
  }
38
41
 
42
+ .p-status-label--information,
39
43
  .p-label--information {
40
- @extend %vf-label;
44
+ @extend %vf-status-label;
41
45
 
42
46
  background-color: $color-information;
43
47
  color: $color-x-light;
44
48
  }
45
49
 
50
+ .p-status-label--negative,
46
51
  .p-label--negative {
47
- @extend %vf-label;
52
+ @extend %vf-status-label;
48
53
 
49
54
  background-color: $color-negative;
50
55
  color: $color-x-light;
51
56
  }
52
57
  }
58
+
59
+ // Deprecated mixin kept for compatibility
60
+ @mixin vf-p-label {
61
+ @include vf-p-status-label;
62
+ }
@@ -21,7 +21,6 @@
21
21
  @import 'patterns_headings';
22
22
  @import 'patterns_icons';
23
23
  @import 'patterns_image';
24
- @import 'patterns_label';
25
24
  @import 'patterns_links';
26
25
  @import 'patterns_list-tree';
27
26
  @import 'patterns_lists';
@@ -39,9 +38,10 @@
39
38
  @import 'patterns_separator';
40
39
  @import 'patterns_side-navigation';
41
40
  @import 'patterns_slider';
41
+ @import 'patterns_status-label';
42
42
  @import 'patterns_strip';
43
43
  @import 'patterns_switch';
44
- @import 'patterns_tab-buttons';
44
+ @import 'patterns_segmented-control';
45
45
  @import 'patterns_table-icons';
46
46
  @import 'patterns_table-expanding';
47
47
  @import 'patterns_table-of-contents';
@@ -102,7 +102,6 @@
102
102
  @include vf-p-form-password-toggle;
103
103
  @include vf-p-icons;
104
104
  @include vf-p-image;
105
- @include vf-p-label;
106
105
  @include vf-p-links;
107
106
  @include vf-p-list-tree;
108
107
  @include vf-p-lists;
@@ -117,12 +116,13 @@
117
116
  @include vf-p-pull-quotes;
118
117
  @include vf-p-search-and-filter;
119
118
  @include vf-p-search-box;
119
+ @include vf-p-segmented-control;
120
120
  @include vf-p-separator;
121
121
  @include vf-p-side-navigation;
122
122
  @include vf-p-slider;
123
+ @include vf-p-status-label;
123
124
  @include vf-p-strip;
124
125
  @include vf-p-switch;
125
- @include vf-p-tab-buttons;
126
126
  @include vf-p-table-icons;
127
127
  @include vf-p-table-expanding;
128
128
  @include vf-p-table-of-contents;