vanilla-framework 3.12.1 → 3.13.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,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-framework",
3
- "version": "3.12.1",
3
+ "version": "3.13.0",
4
4
  "author": {
5
5
  "email": "webteam@canonical.com",
6
6
  "name": "Canonical Webteam"
@@ -485,3 +485,15 @@
485
485
  @mixin vf-icon-desktop($color) {
486
486
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='desktop-2'%3E%3Crect width='16' height='16' /%3E%3Cpath id='Union' fill-rule='evenodd' clip-rule='evenodd' d='M2.5 3.5H13.5V10.5H2.5L2.5 3.5ZM1 3.5C1 2.67157 1.67157 2 2.5 2H13.5C14.3284 2 15 2.67157 15 3.5V10.5C15 11.3284 14.3284 12 13.5 12H8.75V13.25H11V14.75H5V13.25H7.25V12H2.5C1.67157 12 1 11.3284 1 10.5V3.5Z' fill='#{vf-url-friendly-color($color)}'/%3E%3C/g%3E%3C/svg%3E");
487
487
  }
488
+
489
+ @mixin vf-icon-play($color) {
490
+ background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='play'%3E%3Crect width='16' height='16' /%3E%3Cpath id='Triangle (Stroke)' fill-rule='evenodd' clip-rule='evenodd' d='M11.3844 7.98987L5.50005 3.87809L5.50005 12.1161L11.3844 7.98987ZM12.538 9.01296C13.2485 8.51475 13.2476 7.46192 12.5363 6.96488L5.96604 2.37377C5.13747 1.7948 4.00005 2.3876 4.00005 3.3984L4.00005 12.5968C4.00005 13.6085 5.13935 14.2011 5.96773 13.6202L12.538 9.01296Z' fill='#{vf-url-friendly-color($color)}'/%3E%3C/g%3E%3C/svg%3E");
491
+ }
492
+
493
+ @mixin vf-icon-pause($color) {
494
+ background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='pause'%3E%3Crect width='16' height='16' /%3E%3Cpath id='Union' fill-rule='evenodd' clip-rule='evenodd' d='M5.5 3.02393H4V12.9917H5.5V3.02393ZM11.5 3.02393H10V12.9917H11.5V3.02393Z' fill='#{vf-url-friendly-color($color)}'/%3E%3C/g%3E%3C/svg%3E%0A");
495
+ }
496
+
497
+ @mixin vf-icon-stop($color) {
498
+ background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='stop'%3E%3Crect width='16' height='16' /%3E%3Cpath id='Rectangle 13 (Stroke)' fill-rule='evenodd' clip-rule='evenodd' d='M12 3.5H4C3.72386 3.5 3.5 3.72386 3.5 4V12C3.5 12.2761 3.72386 12.5 4 12.5H12C12.2761 12.5 12.5 12.2761 12.5 12V4C12.5 3.72386 12.2761 3.5 12 3.5ZM4 2C2.89543 2 2 2.89543 2 4V12C2 13.1046 2.89543 14 4 14H12C13.1046 14 14 13.1046 14 12V4C14 2.89543 13.1046 2 12 2H4Z' fill='#{vf-url-friendly-color($color)}'/%3E%3C/g%3E%3C/svg%3E%0A");
499
+ }
@@ -1550,3 +1550,39 @@
1550
1550
  }
1551
1551
  }
1552
1552
  }
1553
+
1554
+ @mixin vf-p-icon-play {
1555
+ .p-icon--play {
1556
+ @extend %icon;
1557
+ @include vf-icon-play($color-mid-dark);
1558
+
1559
+ [class*='--dark'] &,
1560
+ &.is-light {
1561
+ @include vf-icon-play($color-mid-x-light);
1562
+ }
1563
+ }
1564
+ }
1565
+
1566
+ @mixin vf-p-icon-pause {
1567
+ .p-icon--pause {
1568
+ @extend %icon;
1569
+ @include vf-icon-pause($color-mid-dark);
1570
+
1571
+ [class*='--dark'] &,
1572
+ &.is-light {
1573
+ @include vf-icon-pause($color-mid-x-light);
1574
+ }
1575
+ }
1576
+ }
1577
+
1578
+ @mixin vf-p-icon-stop {
1579
+ .p-icon--stop {
1580
+ @extend %icon;
1581
+ @include vf-icon-stop($color-mid-dark);
1582
+
1583
+ [class*='--dark'] &,
1584
+ &.is-light {
1585
+ @include vf-icon-stop($color-mid-x-light);
1586
+ }
1587
+ }
1588
+ }
@@ -1,6 +1,5 @@
1
1
  @import 'settings';
2
- $list-status-icon-height: 0.875rem; // 14px value from svg as rem so it can be used in calculations
3
- $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that positions the icon correctly
2
+ $list-status-icon-height: $default-icon-size;
4
3
 
5
4
  @mixin vf-p-list-placeholders {
6
5
  %numbered-step-container {
@@ -69,15 +68,51 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
69
68
  content: '';
70
69
  display: inline-block;
71
70
  height: $sph--large;
72
- margin-right: $sph--large;
73
- position: relative;
74
- top: $sph--x-small;
75
- width: $sph--large;
71
+ top: $spv--small;
72
+ }
73
+
74
+ %vf-list-item-ordered {
75
+ &::marker {
76
+ content: none;
77
+ display: none;
78
+ }
79
+
80
+ &::before {
81
+ color: $color-dark;
82
+ content: counters(list-item, '.') '. ';
83
+ display: inline-block;
84
+ text-align: right;
85
+ }
86
+ }
87
+
88
+ %vf-list-item-bullet {
89
+ &::before {
90
+ color: $color-dark;
91
+ content: '•';
92
+ display: inline-block;
93
+ text-align: right;
94
+ }
95
+ }
96
+ }
97
+
98
+ @mixin vf-list-item-has-prefix {
99
+ padding-left: $sp-x-large;
100
+ position: relative;
101
+
102
+ > .p-list--divided,
103
+ > .p-list {
104
+ margin-left: 0;
105
+ }
106
+
107
+ &::before {
108
+ left: 0;
109
+ position: absolute;
110
+ width: $sp-medium;
76
111
  }
77
112
  }
78
113
 
79
114
  @mixin vf-list-item-divided {
80
- box-shadow: inset 0px 1px 0px 0rem $color-mid-x-light;
115
+ box-shadow: inset 0px 1px 0px 0px $color-mid-x-light;
81
116
  margin: 0;
82
117
  padding-bottom: $sph--large;
83
118
  padding-top: $sph--small;
@@ -95,14 +130,6 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
95
130
  }
96
131
  }
97
132
 
98
- @function svg-tick($color) {
99
- @if type-of($color) != 'color' {
100
- @warn '#{$color} is not a color.';
101
- @return false;
102
- }
103
- @return url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle fill='" + vf-url-friendly-color($color) + "' cx='7' cy='7' r='7'/%3E%3Cpath fill='%23fff' d='M6.1 10.813L2.41 8.105l1.184-1.613L5.9 8.187l4.393-4.394 1.414 1.414z' /%3E%3C/svg%3E");
104
- }
105
-
106
133
  // List styling using list class
107
134
  @mixin vf-p-list {
108
135
  .p-list {
@@ -115,22 +142,6 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
115
142
  }
116
143
  }
117
144
 
118
- %vf-list-item-ordered {
119
- &::marker {
120
- content: none;
121
- display: none;
122
- }
123
-
124
- &::before {
125
- color: $color-dark;
126
- content: counters(list-item, '.') '. ';
127
- display: inline-block;
128
- margin-right: $sph--large;
129
- text-align: right;
130
- width: $sph--large;
131
- }
132
- }
133
-
134
145
  // A list with separators between items
135
146
  @mixin vf-p-list-divided {
136
147
  .p-list--divided {
@@ -139,6 +150,11 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
139
150
  .p-list__item {
140
151
  @extend %vf-list-item;
141
152
  @include vf-list-item-divided;
153
+
154
+ &.is-ticked::before,
155
+ &.is-crossed::before {
156
+ top: $spv--medium;
157
+ }
142
158
  }
143
159
 
144
160
  &.is-split .p-list__item:last-of-type {
@@ -159,8 +175,10 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
159
175
  // stylelint-disable selector-max-type -- we want to target ordered lists
160
176
  ol.p-list--divided {
161
177
  list-style: none;
178
+
162
179
  .p-list__item {
163
180
  @extend %vf-list-item-ordered;
181
+ @include vf-list-item-has-prefix;
164
182
  }
165
183
  }
166
184
  // stylelint-enable selector-max-type -- we want to target ordered lists
@@ -168,37 +186,31 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
168
186
 
169
187
  // Displays item with a state icon
170
188
  @mixin vf-p-list-item-state {
171
- .is-ticked {
189
+ .p-list__item.is-ticked {
190
+ @include vf-list-item-has-prefix;
191
+
172
192
  &::before {
173
193
  @extend %vf-list-item-state-base;
174
194
  @include vf-icon-success;
175
195
  }
176
196
  }
177
197
 
178
- .is-crossed {
198
+ .p-list__item.is-crossed {
199
+ @include vf-list-item-has-prefix;
200
+
179
201
  &::before {
180
202
  @extend %vf-list-item-state-base;
181
203
  @include vf-icon-error;
182
204
  }
183
205
  }
184
- }
185
206
 
186
- %vf-list-item-bullet {
187
- &::before {
188
- color: $color-dark;
189
- content: '•';
190
- display: inline-block;
191
- margin-right: $sph--large;
192
- text-align: right;
193
- width: $sph--large;
207
+ // Displays item with a bullet
208
+ .p-list__item.has-bullet {
209
+ @extend %vf-list-item-bullet;
210
+ @include vf-list-item-has-prefix;
194
211
  }
195
212
  }
196
213
 
197
- // Displays item with a bullet
198
- .has-bullet {
199
- @extend %vf-list-item-bullet;
200
- }
201
-
202
214
  // Displays a list inline with spacing
203
215
  @mixin vf-p-inline-list {
204
216
  .p-inline-list {
@@ -456,7 +468,6 @@ $list-status-icon-nudge: 0.3rem; // 0.3rem seems to be a magic number that posit
456
468
  columns: 2;
457
469
 
458
470
  .p-list__item {
459
- display: inline-block;
460
471
  width: 100%;
461
472
  }
462
473
  }
@@ -57,6 +57,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
57
57
  $properties: #{background-color, color, opacity};
58
58
  @extend %navigation-link-responsive-padding-horizontal;
59
59
  @extend %navigation-link-responsive-padding-vertical;
60
+ @extend %vf-navigation-separator;
60
61
  @include vf-transition($properties, snap);
61
62
  @include vf-focus;
62
63
 
@@ -70,23 +71,19 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
70
71
  line-height: map-get($line-heights, default-text);
71
72
  margin: 0;
72
73
  overflow: hidden;
74
+ padding-left: calc(#{map-get($grid-margin-widths, small)} + #{$sph--x-large}); // allow navigation align with tag logo text on small screens
73
75
  position: relative;
74
76
  text-align: left;
75
77
  text-overflow: ellipsis;
76
78
  white-space: nowrap;
77
79
  width: 100%;
78
80
 
79
- &::before {
80
- content: '';
81
- height: 1px;
82
- left: 0;
83
- position: absolute;
84
- right: 0;
85
- top: 0;
81
+ @media (min-width: $threshold-4-6-col) {
82
+ padding-left: calc(#{map-get($grid-margin-widths, default)} + #{$sph--x-large});
83
+ }
86
84
 
87
- @media (min-width: $breakpoint-navigation-threshold) {
88
- content: none;
89
- }
85
+ @media (min-width: $breakpoint-navigation-threshold) {
86
+ padding-left: $sph--large;
90
87
  }
91
88
 
92
89
  &:visited,
@@ -101,6 +98,25 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
101
98
  padding-right: 0;
102
99
  }
103
100
 
101
+ %vf-navigation-separator {
102
+ &::before {
103
+ content: '';
104
+ height: 1px;
105
+ left: calc(#{map-get($grid-margin-widths, small)} + #{$sph--x-large});
106
+ position: absolute;
107
+ right: 0;
108
+ top: 0;
109
+
110
+ @media (min-width: $threshold-4-6-col) {
111
+ left: calc(#{map-get($grid-margin-widths, default)} + #{$sph--x-large});
112
+ }
113
+
114
+ @media (min-width: $breakpoint-navigation-threshold) {
115
+ content: none;
116
+ }
117
+ }
118
+ }
119
+
104
120
  .p-navigation {
105
121
  display: flex;
106
122
  flex-direction: column;
@@ -190,6 +206,17 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
190
206
  justify-content: space-between;
191
207
  padding-right: 0;
192
208
 
209
+ .p-navigation__link {
210
+ // reset padding for navigation links in the navigation banner
211
+ @extend %navigation-link-responsive-padding-horizontal;
212
+ @extend %navigation-link-responsive-padding-vertical;
213
+
214
+ // remove navigation separator for navigation links in the navigation banner
215
+ &::before {
216
+ content: none;
217
+ }
218
+ }
219
+
193
220
  @media (min-width: $threshold-4-6-col) {
194
221
  padding-left: map-get($grid-margin-widths, default);
195
222
  padding-right: 0;
@@ -270,10 +297,18 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
270
297
 
271
298
  // navigation items
272
299
  .p-navigation__items {
300
+ @extend %vf-navigation-separator;
301
+
273
302
  display: none; // hidden by default on mobile (expands is a dropdown)
274
303
  list-style: none;
275
304
  margin: -1px 0 0 0;
276
305
  padding: 0;
306
+ position: relative;
307
+
308
+ // remove navigation separator for the first navigation items list
309
+ &:first-child::before {
310
+ content: none;
311
+ }
277
312
 
278
313
  @media (min-width: $breakpoint-navigation-threshold) {
279
314
  display: flex;
@@ -301,6 +336,11 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
301
336
  flex-wrap: wrap;
302
337
  margin-top: 0; // prevents bottom border of nav from moving 1px
303
338
 
339
+ // remove separtion for navigation items in the navigation banner
340
+ &::before {
341
+ content: none;
342
+ }
343
+
304
344
  @media (min-width: $breakpoint-navigation-threshold) {
305
345
  display: none;
306
346
  }
@@ -544,6 +584,7 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
544
584
  right: map-get($grid-margin-widths, small);
545
585
  text-indent: calc(100% + 10rem);
546
586
  top: calc($spv--large + map-get($nudges, x-small));
587
+ transform: rotate(-90deg);
547
588
  width: map-get($icon-sizes, default);
548
589
 
549
590
  @media (min-width: $threshold-4-6-col) {
@@ -552,12 +593,17 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
552
593
 
553
594
  @media (min-width: $breakpoint-navigation-threshold) {
554
595
  right: calc($sph--small + 1px); // 1px for the border on selects. this aligns it with any selects underneath
596
+ transform: rotate(0deg);
555
597
  }
556
598
  }
557
599
 
558
600
  &.is-active {
559
601
  &::after {
560
- transform: rotate(180deg);
602
+ transform: rotate(0deg);
603
+
604
+ @media (min-width: $breakpoint-navigation-threshold) {
605
+ transform: rotate(180deg);
606
+ }
561
607
  }
562
608
 
563
609
  .p-navigation__dropdown,
@@ -570,18 +616,29 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
570
616
  // add padding to accommodate icon
571
617
  padding-right: 2 * $sph--small + map-get($icon-sizes, default);
572
618
  }
619
+
620
+ &:first-child .p-navigation__link::before {
621
+ content: none;
622
+ }
573
623
  }
574
624
 
575
625
  .p-navigation__dropdown-item {
576
626
  @extend %navigation-link-responsive-padding-horizontal;
627
+ @extend %navigation-link-responsive-padding-vertical;
628
+ @extend %vf-navigation-separator;
577
629
 
578
630
  display: block;
579
- padding-bottom: $spv--small;
580
- padding-top: $spv--small;
631
+ padding-left: calc(#{map-get($grid-margin-widths, small)} + #{$sph--x-large}); // make dropdown items align with the tag logo text
632
+ position: relative;
581
633
  white-space: nowrap;
582
634
 
635
+ @media (min-width: $threshold-4-6-col) {
636
+ padding-left: calc(#{map-get($grid-margin-widths, default)} + #{$sph--x-large});
637
+ }
638
+
583
639
  @media (min-width: $breakpoint-navigation-threshold) {
584
640
  padding-bottom: $spv--medium;
641
+ padding-left: $sph--large;
585
642
  padding-top: $spv--medium;
586
643
  }
587
644
 
@@ -685,7 +742,10 @@ $spv-navigation-logo-bottom-position: 0.125rem; // 2px when 1rem is 16px
685
742
  }
686
743
  }
687
744
 
688
- .p-navigation__nav .p-navigation__link::before {
745
+ // add color to separator line for navigation items, navigation links and dropdown items
746
+ .p-navigation__nav .p-navigation__link::before,
747
+ .p-navigation__nav .p-navigation__items::before,
748
+ .p-navigation__nav .p-navigation__items .p-navigation__dropdown-item::before {
689
749
  background: $color-navigation-separator;
690
750
  }
691
751