vanilla-framework 3.0.0-beta.1 → 3.0.0-beta.2

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
@@ -43,7 +43,7 @@
43
43
  "percy": "percy exec -- node snapshots.js",
44
44
  "icon-svgs-to-mixins": "node scripts/convert-svgs-to-icon-mixins.js icons"
45
45
  },
46
- "version": "3.0.0-beta.1",
46
+ "version": "3.0.0-beta.2",
47
47
  "files": [
48
48
  "_index.scss",
49
49
  "/scss",
@@ -57,7 +57,7 @@
57
57
  font-size: #{map-get($font-sizes, small)}rem;
58
58
  line-height: map-get($line-heights, small);
59
59
  margin-bottom: $input-margin-bottom - $sp-unit;
60
- padding: calc(#{map-get($nudges, nudge--small)} - 1px) $sph--small;
60
+ padding: calc(#{map-get($nudges, small)} - 1px) $sph--small;
61
61
  }
62
62
 
63
63
  &.is-small.is-dense {
@@ -10,8 +10,8 @@
10
10
  @include vf-focus;
11
11
 
12
12
  margin-bottom: $spv-nudge; //push subsequent text onto baseline
13
- max-width: $max-width--default;
14
- padding-bottom: 2 * $sp-unit - map-get($nudges, nudge--p); // use padding instead of margin-bottom in order to make the focus state symmetric
13
+ max-width: $text-max-width;
14
+ padding-bottom: 2 * $sp-unit - map-get($nudges, p); // use padding instead of margin-bottom in order to make the focus state symmetric
15
15
  }
16
16
  // stylelint-enable selector-max-type
17
17
  }
@@ -85,8 +85,8 @@
85
85
  display: inline-block;
86
86
  margin-bottom: $spv--large - $spv-nudge;
87
87
  margin-top: 0;
88
- max-width: $max-width--default;
89
- padding-top: map-get($nudges, nudge--p);
88
+ max-width: $text-max-width;
89
+ padding-top: map-get($nudges, p);
90
90
  width: fit-content;
91
91
 
92
92
  &.is-required::before {
@@ -150,55 +150,55 @@
150
150
  }
151
151
 
152
152
  %u-no-margin--bottom--h1 {
153
- margin-bottom: -#{map-get($nudges, nudge--h1-mobile)} !important;
153
+ margin-bottom: -#{map-get($nudges, h1-mobile)} !important;
154
154
 
155
155
  @media (min-width: $breakpoint-heading-threshold) {
156
- margin-bottom: -#{map-get($nudges, nudge--h1)} !important;
156
+ margin-bottom: -#{map-get($nudges, h1)} !important;
157
157
  }
158
158
 
159
159
  @if ($increase-font-size-on-larger-screens) {
160
160
  @media (min-width: $breakpoint-x-large) {
161
- margin-bottom: -#{map-get($nudges, nudge--h1-large)} !important;
161
+ margin-bottom: -#{map-get($nudges, h1-large)} !important;
162
162
  }
163
163
  }
164
164
  }
165
165
 
166
166
  %u-no-margin--bottom--h2 {
167
- margin-bottom: -#{map-get($nudges, nudge--h2-mobile)} !important;
167
+ margin-bottom: -#{map-get($nudges, h2-mobile)} !important;
168
168
 
169
169
  @media (min-width: $breakpoint-heading-threshold) {
170
- margin-bottom: -#{map-get($nudges, nudge--h2)} !important;
170
+ margin-bottom: -#{map-get($nudges, h2)} !important;
171
171
  }
172
172
  }
173
173
 
174
174
  %u-no-margin--bottom--h3 {
175
- margin-bottom: #{$sp-unit - map-get($nudges, nudge--h3-mobile)} !important;
175
+ margin-bottom: #{$sp-unit - map-get($nudges, h3-mobile)} !important;
176
176
 
177
177
  @media (min-width: $breakpoint-heading-threshold) {
178
- margin-bottom: -#{map-get($nudges, nudge--h3)} !important;
178
+ margin-bottom: -#{map-get($nudges, h3)} !important;
179
179
  }
180
180
  }
181
181
 
182
182
  %u-no-margin--bottom--h4 {
183
- margin-bottom: #{$sp-unit - map-get($nudges, nudge--h4-mobile)} !important;
183
+ margin-bottom: #{$sp-unit - map-get($nudges, h4-mobile)} !important;
184
184
 
185
185
  @media (min-width: $breakpoint-heading-threshold) {
186
- margin-bottom: -#{map-get($nudges, nudge--h4)} !important;
186
+ margin-bottom: -#{map-get($nudges, h4)} !important;
187
187
  }
188
188
 
189
189
  @if ($increase-font-size-on-larger-screens) {
190
190
  @media (min-width: $breakpoint-x-large) {
191
- margin-bottom: -#{map-get($nudges, nudge--h4-large)} !important;
191
+ margin-bottom: -#{map-get($nudges, h4-large)} !important;
192
192
  }
193
193
  }
194
194
  }
195
195
 
196
196
  %u-no-margin--bottom--default-text {
197
- margin-bottom: #{$sp-unit - map-get($nudges, nudge--p)} !important;
197
+ margin-bottom: #{$sp-unit - map-get($nudges, p)} !important;
198
198
  }
199
199
 
200
200
  %u-no-margin--bottom--small {
201
- margin-bottom: -#{map-get($nudges, nudge--small)} !important;
201
+ margin-bottom: -#{map-get($nudges, small)} !important;
202
202
  }
203
203
 
204
204
  %u-no-margin--bottom--hr {
@@ -40,8 +40,8 @@
40
40
  th {
41
41
  @extend %table-header-label;
42
42
 
43
- padding-bottom: $spv--large - map-get($nudges, nudge--x-small);
44
- padding-top: map-get($nudges, nudge--x-small) + map-get($browser-rounding-compensations, small) + $sp-unit;
43
+ padding-bottom: $spv--large - map-get($nudges, x-small);
44
+ padding-top: map-get($nudges, x-small) + map-get($browser-rounding-compensations, small) + $sp-unit;
45
45
  }
46
46
 
47
47
  tr {
@@ -5,22 +5,22 @@
5
5
  font-style: normal;
6
6
  font-weight: $font-weight-display-heading;
7
7
  line-height: map-get($line-heights, h1-mobile);
8
- margin-bottom: map-get($sp-after, h1-mobile) - map-get($nudges, nudge--h1-mobile);
8
+ margin-bottom: map-get($sp-after, h1-mobile) - map-get($nudges, h1-mobile);
9
9
  margin-top: 0;
10
- max-width: $max-width--default;
11
- padding-top: map-get($nudges, nudge--h1-mobile) + map-get($browser-rounding-compensations, h1);
10
+ max-width: $text-max-width;
11
+ padding-top: map-get($nudges, h1-mobile) + map-get($browser-rounding-compensations, h1);
12
12
 
13
13
  @media (min-width: $breakpoint-heading-threshold) {
14
14
  font-size: #{map-get($font-sizes, h1)}rem;
15
15
  line-height: map-get($line-heights, h1);
16
- margin-bottom: map-get($sp-after, h1) - map-get($nudges, nudge--h1);
17
- padding-top: map-get($nudges, nudge--h1) + map-get($browser-rounding-compensations, h1);
16
+ margin-bottom: map-get($sp-after, h1) - map-get($nudges, h1);
17
+ padding-top: map-get($nudges, h1) + map-get($browser-rounding-compensations, h1);
18
18
  }
19
19
 
20
20
  @if ($increase-font-size-on-larger-screens) {
21
21
  @media (min-width: $breakpoint-x-large) {
22
- margin-bottom: map-get($sp-after, h1) - map-get($nudges, nudge--h1-large);
23
- padding-top: map-get($nudges, nudge--h1-large) + map-get($browser-rounding-compensations, h1);
22
+ margin-bottom: map-get($sp-after, h1) - map-get($nudges, h1-large);
23
+ padding-top: map-get($nudges, h1-large) + map-get($browser-rounding-compensations, h1);
24
24
  }
25
25
  }
26
26
 
@@ -34,16 +34,16 @@
34
34
  font-style: normal;
35
35
  font-weight: $font-weight-display-heading;
36
36
  line-height: map-get($line-heights, h2-mobile);
37
- margin-bottom: map-get($sp-after, h2-mobile) - map-get($nudges, nudge--h2-mobile);
37
+ margin-bottom: map-get($sp-after, h2-mobile) - map-get($nudges, h2-mobile);
38
38
  margin-top: 0;
39
- max-width: $max-width--default;
40
- padding-top: map-get($nudges, nudge--h2-mobile) + map-get($browser-rounding-compensations, h2);
39
+ max-width: $text-max-width;
40
+ padding-top: map-get($nudges, h2-mobile) + map-get($browser-rounding-compensations, h2);
41
41
 
42
42
  @media (min-width: $breakpoint-heading-threshold) {
43
43
  font-size: #{map-get($font-sizes, h2)}rem;
44
44
  line-height: map-get($line-heights, h2);
45
- margin-bottom: map-get($sp-after, h2) - map-get($nudges, nudge--h2);
46
- padding-top: map-get($nudges, nudge--h2) + map-get($browser-rounding-compensations, h2);
45
+ margin-bottom: map-get($sp-after, h2) - map-get($nudges, h2);
46
+ padding-top: map-get($nudges, h2) + map-get($browser-rounding-compensations, h2);
47
47
  }
48
48
 
49
49
  &.u-no-margin--bottom {
@@ -56,16 +56,16 @@
56
56
  font-style: normal;
57
57
  font-weight: $font-weight-display-heading;
58
58
  line-height: map-get($line-heights, h3-mobile);
59
- margin-bottom: map-get($sp-after, h3-mobile) - map-get($nudges, nudge--h3-mobile);
59
+ margin-bottom: map-get($sp-after, h3-mobile) - map-get($nudges, h3-mobile);
60
60
  margin-top: 0;
61
- max-width: $max-width--default;
62
- padding-top: map-get($nudges, nudge--h3-mobile);
61
+ max-width: $text-max-width;
62
+ padding-top: map-get($nudges, h3-mobile);
63
63
 
64
64
  @media (min-width: $breakpoint-heading-threshold) {
65
65
  font-size: #{map-get($font-sizes, h3)}rem;
66
66
  line-height: map-get($line-heights, h3);
67
- margin-bottom: map-get($sp-after, h3) - map-get($nudges, nudge--h3);
68
- padding-top: map-get($nudges, nudge--h3) + map-get($browser-rounding-compensations, h3);
67
+ margin-bottom: map-get($sp-after, h3) - map-get($nudges, h3);
68
+ padding-top: map-get($nudges, h3) + map-get($browser-rounding-compensations, h3);
69
69
  }
70
70
 
71
71
  &.u-no-margin--bottom {
@@ -78,22 +78,22 @@
78
78
  font-style: normal;
79
79
  font-weight: $font-weight-regular-text;
80
80
  line-height: map-get($line-heights, h4-mobile);
81
- margin-bottom: map-get($sp-after, h4-mobile) - map-get($nudges, nudge--h4-mobile);
81
+ margin-bottom: map-get($sp-after, h4-mobile) - map-get($nudges, h4-mobile);
82
82
  margin-top: 0;
83
- max-width: $max-width--default;
84
- padding-top: map-get($nudges, nudge--h4-mobile) + map-get($browser-rounding-compensations, h4);
83
+ max-width: $text-max-width;
84
+ padding-top: map-get($nudges, h4-mobile) + map-get($browser-rounding-compensations, h4);
85
85
 
86
86
  @media (min-width: $breakpoint-heading-threshold) {
87
87
  font-size: #{map-get($font-sizes, h4)}rem;
88
88
  line-height: map-get($line-heights, h4);
89
- margin-bottom: map-get($sp-after, h4) - map-get($nudges, nudge--h4);
90
- padding-top: map-get($nudges, nudge--h4) + map-get($browser-rounding-compensations, h4);
89
+ margin-bottom: map-get($sp-after, h4) - map-get($nudges, h4);
90
+ padding-top: map-get($nudges, h4) + map-get($browser-rounding-compensations, h4);
91
91
  }
92
92
 
93
93
  @if ($increase-font-size-on-larger-screens) {
94
94
  @media (min-width: $breakpoint-x-large) {
95
- margin-bottom: map-get($sp-after, h4) - map-get($nudges, nudge--h4-large);
96
- padding-top: map-get($nudges, nudge--h4-large) + map-get($browser-rounding-compensations, h4);
95
+ margin-bottom: map-get($sp-after, h4) - map-get($nudges, h4-large);
96
+ padding-top: map-get($nudges, h4-large) + map-get($browser-rounding-compensations, h4);
97
97
  }
98
98
  }
99
99
 
@@ -107,10 +107,10 @@
107
107
  font-style: normal;
108
108
  font-weight: $font-weight-bold;
109
109
  line-height: map-get($line-heights, default-text);
110
- margin-bottom: map-get($sp-after, p) - map-get($nudges, nudge--p);
110
+ margin-bottom: map-get($sp-after, p) - map-get($nudges, p);
111
111
  margin-top: 0;
112
- max-width: $max-width--default;
113
- padding-top: map-get($nudges, nudge--p) + map-get($browser-rounding-compensations, h5);
112
+ max-width: $text-max-width;
113
+ padding-top: map-get($nudges, p) + map-get($browser-rounding-compensations, h5);
114
114
 
115
115
  &.u-no-margin--bottom {
116
116
  @extend %u-no-margin--bottom--default-text;
@@ -122,14 +122,14 @@
122
122
  font-style: italic;
123
123
  font-weight: $font-weight-regular-text;
124
124
  line-height: map-get($line-heights, default-text);
125
- margin-bottom: map-get($sp-after, p) - map-get($nudges, nudge--p);
125
+ margin-bottom: map-get($sp-after, p) - map-get($nudges, p);
126
126
  margin-top: 0;
127
- max-width: $max-width--default;
128
- padding-top: map-get($nudges, nudge--h6) + map-get($browser-rounding-compensations, h6);
127
+ max-width: $text-max-width;
128
+ padding-top: map-get($nudges, h6) + map-get($browser-rounding-compensations, h6);
129
129
 
130
130
  @if ($increase-font-size-on-larger-screens) {
131
131
  @media (min-width: $breakpoint-x-large) {
132
- padding-top: map-get($nudges, nudge--h6-large) + map-get($browser-rounding-compensations, h6);
132
+ padding-top: map-get($nudges, h6-large) + map-get($browser-rounding-compensations, h6);
133
133
  }
134
134
  }
135
135
 
@@ -141,19 +141,19 @@
141
141
  %common-default-text-properties {
142
142
  line-height: map-get($line-heights, default-text);
143
143
  margin-top: 0;
144
- padding-top: map-get($nudges, nudge--p) + map-get($browser-rounding-compensations, p);
144
+ padding-top: map-get($nudges, p) + map-get($browser-rounding-compensations, p);
145
145
  }
146
146
 
147
147
  %default-text {
148
148
  @extend %common-default-text-properties;
149
149
 
150
- margin-bottom: map-get($sp-after, default-text) - map-get($nudges, nudge--p);
150
+ margin-bottom: map-get($sp-after, default-text) - map-get($nudges, p);
151
151
  }
152
152
 
153
153
  %paragraph {
154
154
  @extend %common-default-text-properties;
155
155
 
156
- margin-bottom: map-get($sp-after, p) - map-get($nudges, nudge--p);
156
+ margin-bottom: map-get($sp-after, p) - map-get($nudges, p);
157
157
 
158
158
  &:not([class*='p-heading--']):not([class*='p-muted-heading']) + & {
159
159
  margin-top: -#{$sp-unit};
@@ -167,12 +167,12 @@
167
167
  %small-text {
168
168
  font-size: #{map-get($font-sizes, small)}rem;
169
169
  line-height: map-get($line-heights, small);
170
- margin-bottom: map-get($sp-after, small) - map-get($nudges, nudge--small);
171
- padding-top: map-get($nudges, nudge--small) + map-get($browser-rounding-compensations, small);
170
+ margin-bottom: map-get($sp-after, small) - map-get($nudges, small);
171
+ padding-top: map-get($nudges, small) + map-get($browser-rounding-compensations, small);
172
172
 
173
173
  @if ($increase-font-size-on-larger-screens) {
174
174
  @media (min-width: $breakpoint-x-large) {
175
- padding-top: map-get($nudges, nudge--small) + map-get($browser-rounding-compensations, small-largescreen);
175
+ padding-top: map-get($nudges, small) + map-get($browser-rounding-compensations, small-largescreen);
176
176
  }
177
177
  }
178
178
 
@@ -185,12 +185,12 @@
185
185
  font-size: #{map-get($font-sizes, x-small)}rem;
186
186
  font-weight: $font-weight-bold;
187
187
  line-height: map-get($line-heights, x-small);
188
- margin-bottom: map-get($sp-after, x-small) - map-get($nudges, nudge--x-small);
189
- padding-top: map-get($nudges, nudge--x-small) + map-get($browser-rounding-compensations, small);
188
+ margin-bottom: map-get($sp-after, x-small) - map-get($nudges, x-small);
189
+ padding-top: map-get($nudges, x-small) + map-get($browser-rounding-compensations, small);
190
190
 
191
191
  @if ($increase-font-size-on-larger-screens) {
192
192
  @media (min-width: $breakpoint-x-large) {
193
- padding-top: map-get($nudges, nudge--x-small) + map-get($browser-rounding-compensations, small-largescreen);
193
+ padding-top: map-get($nudges, x-small) + map-get($browser-rounding-compensations, small-largescreen);
194
194
  }
195
195
  }
196
196
 
@@ -226,42 +226,42 @@
226
226
  // Placeholder naming: $sp + -- + {preceding element} + {following element}, e.g. for p + h1: $sp--ph1
227
227
 
228
228
  %sp--ph1 {
229
- padding-top: map-get($nudges, nudge--h1-mobile) + $spv--x-large;
229
+ padding-top: map-get($nudges, h1-mobile) + $spv--x-large;
230
230
 
231
231
  @media (min-width: $breakpoint-heading-threshold) {
232
- padding-top: map-get($nudges, nudge--h1) + $spv--x-large;
232
+ padding-top: map-get($nudges, h1) + $spv--x-large;
233
233
  }
234
234
  }
235
235
 
236
236
  %sp--ph2 {
237
- padding-top: map-get($nudges, nudge--h2-mobile) + $spv--x-large;
237
+ padding-top: map-get($nudges, h2-mobile) + $spv--x-large;
238
238
 
239
239
  @media (min-width: $breakpoint-heading-threshold) {
240
- padding-top: map-get($nudges, nudge--h2) + $spv--x-large;
240
+ padding-top: map-get($nudges, h2) + $spv--x-large;
241
241
  }
242
242
  }
243
243
 
244
244
  %sp--ph3 {
245
- padding-top: map-get($nudges, nudge--h3-mobile) + $spv--x-large;
245
+ padding-top: map-get($nudges, h3-mobile) + $spv--x-large;
246
246
 
247
247
  @media (min-width: $breakpoint-heading-threshold) {
248
- padding-top: map-get($nudges, nudge--h3) + $spv--x-large;
248
+ padding-top: map-get($nudges, h3) + $spv--x-large;
249
249
  }
250
250
  }
251
251
 
252
252
  %sp--ph4 {
253
- padding-top: map-get($nudges, nudge--h4-mobile) + $spv--x-large;
253
+ padding-top: map-get($nudges, h4-mobile) + $spv--x-large;
254
254
 
255
255
  @media (min-width: $breakpoint-heading-threshold) {
256
- padding-top: map-get($nudges, nudge--h4) + $spv--x-large;
256
+ padding-top: map-get($nudges, h4) + $spv--x-large;
257
257
  }
258
258
  }
259
259
 
260
260
  %sp--ph5 {
261
- padding-top: map-get($nudges, nudge--p) + $spv--x-large;
261
+ padding-top: map-get($nudges, p) + $spv--x-large;
262
262
  }
263
263
 
264
264
  %sp--pmuted {
265
- padding-top: map-get($nudges, nudge--small) + $spv--x-large;
265
+ padding-top: map-get($nudges, small) + $spv--x-large;
266
266
  }
267
267
  }
@@ -58,7 +58,7 @@
58
58
  p {
59
59
  @extend %paragraph;
60
60
 
61
- max-width: $max-width--default;
61
+ max-width: $text-max-width;
62
62
  }
63
63
 
64
64
  .p-text--default {
@@ -70,7 +70,7 @@
70
70
  @extend %small-text;
71
71
 
72
72
  &.dense {
73
- margin-bottom: map-get($sp-after, small--dense) + map-get($line-heights, default-text) - map-get($line-heights, small) - map-get($nudges, nudge--small);
73
+ margin-bottom: map-get($sp-after, small--dense) + map-get($line-heights, default-text) - map-get($line-heights, small) - map-get($nudges, small);
74
74
  }
75
75
  }
76
76
 
@@ -1,66 +1,48 @@
1
1
  @import 'settings';
2
2
 
3
3
  @mixin vf-p-chip {
4
- $chip-line-height: 1rem;
5
- $base-background-opacity-amount: 0.05;
6
- $color-background-base: adjust-color($color-x-dark, $lightness: 100% * (1 - $base-background-opacity-amount));
7
- $color-background-hover: adjust-color($color-x-dark, $lightness: 100% * (1 - ($base-background-opacity-amount + $hover-background-opacity-amount)));
8
-
9
- .p-chip {
4
+ %vf-chip {
10
5
  @extend %small-text;
6
+ @include vf-animation(#{background-color, border-color}, snap, out);
7
+ @include vf-focus;
11
8
 
12
- background-color: $color-background-base;
13
- border-radius: $chip-line-height;
9
+ align-items: baseline;
10
+ border-radius: 1rem;
14
11
  display: inline-flex;
15
- line-height: $chip-line-height;
16
- margin: map-get($nudges, nudge--p) $sph--small 0 0;
12
+ margin: 0 $sph--small $input-margin-bottom 0;
17
13
  max-width: 100%;
18
- padding-bottom: 0.25rem;
19
- padding-left: $sph--large;
20
- padding-right: $sph--large;
21
- padding-top: 0.25rem;
14
+ padding: calc(#{$spv--x-small} - 1px) $sph--small; // account for border thickness using calc
15
+ position: relative;
22
16
  user-select: none;
17
+ vertical-align: calc(1px - #{map-get($nudges, p)});
23
18
  white-space: nowrap;
24
19
 
25
- &:hover {
26
- background-color: $color-background-hover;
27
- }
28
-
29
- &.is-selected,
30
- &:active {
31
- background-color: $colors--light-theme--background-active;
32
- }
33
-
34
20
  .p-chip__lead,
35
21
  .p-chip__value {
22
+ display: inline;
36
23
  margin-bottom: 0;
37
24
  overflow: hidden;
25
+ padding: 0;
38
26
  text-overflow: ellipsis;
27
+ vertical-align: baseline;
39
28
  }
40
29
 
41
30
  .p-chip__lead {
42
- $space-between-lead-and-value: 0.25rem;
43
31
  @extend %muted-text;
44
32
  @extend %x-small-text;
45
33
 
46
- line-height: $chip-line-height;
47
- padding-right: $space-between-lead-and-value * 2;
48
- padding-top: 0.1rem;
49
- position: relative;
50
34
  text-transform: uppercase;
35
+ }
36
+
37
+ .p-chip__lead + .p-chip__value::before {
38
+ @extend %muted-text;
39
+ @extend %x-small-text;
51
40
 
52
- &::after {
53
- content: '\00a0:';
54
- position: absolute;
55
- right: $space-between-lead-and-value;
56
- }
41
+ content: ': ';
57
42
  }
58
43
 
59
44
  .p-chip__value {
60
45
  @extend %small-text;
61
-
62
- line-height: $chip-line-height;
63
- padding-top: 0.05rem;
64
46
  }
65
47
 
66
48
  .p-chip__dismiss {
@@ -71,20 +53,84 @@
71
53
  $button-hover-border-color: transparent
72
54
  );
73
55
 
56
+ align-self: center;
74
57
  border: none;
75
- display: block;
76
58
  flex: 0 0 auto;
77
- left: $sp-unit * 0.5;
78
- line-height: 1rem;
59
+ height: $default-icon-size;
60
+ line-height: $default-icon-size;
79
61
  margin-bottom: 0;
80
- margin-right: -$sp-unit * 0.5;
62
+ margin-left: $sph--x-small;
63
+ margin-top: 0; // override top margin that button gets in some contexts (in paragraphs)
81
64
  padding: 0;
82
65
  position: relative;
83
- top: 0.05rem;
66
+ width: $default-icon-size;
67
+ }
68
+
69
+ &.is-dense {
70
+ padding: 0 $sph--small;
71
+ }
84
72
 
85
- [class*='p-icon'] {
86
- vertical-align: calc(#{0.5 * $cap-height} - #{0.5 * $default-icon-size});
87
- }
73
+ &.is-inline {
74
+ margin-bottom: 0;
75
+ margin-top: 0;
76
+ vertical-align: baseline;
88
77
  }
89
78
  }
79
+
80
+ @include vf-chip-default;
81
+ @include vf-chip-positive;
82
+ @include vf-chip-caution;
83
+ @include vf-chip-negative;
84
+ @include vf-chip-information;
85
+ }
86
+
87
+ @mixin vf-chip-default {
88
+ .p-chip {
89
+ @extend %vf-chip;
90
+ @include vf-chip-type(default);
91
+ }
92
+ }
93
+
94
+ @mixin vf-chip-positive {
95
+ .p-chip--positive {
96
+ @extend %vf-chip;
97
+ @include vf-chip-type(positive);
98
+ }
99
+ }
100
+
101
+ @mixin vf-chip-caution {
102
+ .p-chip--caution {
103
+ @extend %vf-chip;
104
+ @include vf-chip-type(caution);
105
+ }
106
+ }
107
+
108
+ @mixin vf-chip-negative {
109
+ .p-chip--negative {
110
+ @extend %vf-chip;
111
+ @include vf-chip-type(negative);
112
+ }
113
+ }
114
+
115
+ @mixin vf-chip-information {
116
+ .p-chip--information {
117
+ @extend %vf-chip;
118
+ @include vf-chip-type(information);
119
+ }
120
+ }
121
+
122
+ @mixin vf-chip-type($type: neutral) {
123
+ $color-background: null;
124
+ $color-border: null;
125
+
126
+ @if (map-has-key($colors-light-theme--tinted-backgrounds, $type)) {
127
+ $color-background: map-get($colors-light-theme--tinted-backgrounds, $type);
128
+ $color-border: map-get($colors-light-theme--tinted-borders, $type);
129
+ } @else {
130
+ $color-background: map-get($colors-light-theme--tinted-backgrounds, neutral);
131
+ $color-border: map-get($colors-light-theme--tinted-borders, neutral);
132
+ }
133
+
134
+ background-color: $color-background;
135
+ border: 1px solid $color-border;
90
136
  }
@@ -22,12 +22,12 @@
22
22
  height: map-get($icon-sizes, heading-icon--small);
23
23
  margin-bottom: 0;
24
24
  margin-right: $sph--large;
25
- margin-top: map-get($nudges, nudge--h3-mobile);
25
+ margin-top: map-get($nudges, h3-mobile);
26
26
  width: map-get($icon-sizes, heading-icon--small);
27
27
 
28
28
  @media (min-width: $breakpoint-heading-threshold) {
29
29
  height: map-get($icon-sizes, heading-icon);
30
- margin-top: map-get($nudges, nudge--h3);
30
+ margin-top: map-get($nudges, h3);
31
31
  width: map-get($icon-sizes, heading-icon);
32
32
  }
33
33
  }
@@ -9,7 +9,7 @@
9
9
  border-radius: $border-radius;
10
10
  display: inline-block;
11
11
  font-weight: $font-weight-bold;
12
- padding: map-get($nudges, nudge--x-small) $sph--small;
12
+ padding: map-get($nudges, x-small) $sph--small;
13
13
  text-align: center;
14
14
  text-decoration: none;
15
15
  white-space: nowrap;
@@ -101,12 +101,12 @@
101
101
  width: $matrix-img-width;
102
102
 
103
103
  @media (min-width: $breakpoint-heading-threshold) {
104
- margin-top: -#{map-get($nudges, nudge--h4)};
104
+ margin-top: -#{map-get($nudges, h4)};
105
105
  }
106
106
 
107
107
  @if ($increase-font-size-on-larger-screens) {
108
108
  @media (min-width: $breakpoint-x-large) {
109
- margin-top: -#{map-get($nudges, nudge--h4-large)};
109
+ margin-top: -#{map-get($nudges, h4-large)};
110
110
  }
111
111
  }
112
112
  }
@@ -126,12 +126,12 @@
126
126
  @extend %vf-heading-4;
127
127
 
128
128
  @media (min-width: $breakpoint-heading-threshold) {
129
- margin-bottom: -#{map-get($nudges, nudge--h4)};
129
+ margin-bottom: -#{map-get($nudges, h4)};
130
130
  }
131
131
 
132
132
  @if ($increase-font-size-on-larger-screens) {
133
133
  @media (min-width: $breakpoint-x-large) {
134
- margin-bottom: -#{map-get($nudges, nudge--h4-large)};
134
+ margin-bottom: -#{map-get($nudges, h4-large)};
135
135
  }
136
136
  }
137
137
  }
@@ -332,7 +332,7 @@ $lightness-threshold: 70;
332
332
  position: absolute;
333
333
  right: map-get($grid-margin-widths, small);
334
334
  text-indent: calc(100% + 10rem);
335
- top: calc(#{$spv--large} + #{map-get($nudges, nudge--x-small)});
335
+ top: calc(#{$spv--large} + #{map-get($nudges, x-small)});
336
336
  width: map-get($icon-sizes, default);
337
337
 
338
338
  @media (min-width: $threshold-4-6-col) {
@@ -435,7 +435,7 @@ $lightness-threshold: 70;
435
435
  position: absolute;
436
436
  right: map-get($grid-margin-widths, small);
437
437
  text-indent: calc(100% + 10rem);
438
- top: calc(#{$spv--large} + #{map-get($nudges, nudge--x-small)});
438
+ top: calc(#{$spv--large} + #{map-get($nudges, x-small)});
439
439
  width: map-get($icon-sizes, default);
440
440
 
441
441
  @media (min-width: $threshold-4-6-col) {
@@ -47,8 +47,8 @@
47
47
  }
48
48
 
49
49
  .p-chip {
50
- margin-bottom: $sp-x-small;
51
- margin-top: $sp-x-small;
50
+ margin-bottom: $spv--x-small;
51
+ margin-top: $spv--x-small;
52
52
  }
53
53
 
54
54
  .p-search-and-filter__selected-count {
@@ -3,11 +3,13 @@ $knob-size: $sp-unit * 3;
3
3
 
4
4
  @mixin vf-p-switch {
5
5
  .p-switch {
6
- height: $knob-size;
6
+ display: flex;
7
+ }
8
+
9
+ .p-switch__input {
7
10
  margin: 0;
8
- opacity: 0 !important; // override higher specificity of [type='checkbox'] selector
9
- position: absolute !important; // override higher specificity of [type='checkbox'] selector
10
- width: $knob-size * 2;
11
+ opacity: 0;
12
+ position: absolute;
11
13
 
12
14
  &:checked + .p-switch__slider::before {
13
15
  left: 50%;
@@ -31,9 +33,9 @@ $knob-size: $sp-unit * 3;
31
33
 
32
34
  background: linear-gradient(to right, $color-link 50%, $color-mid-light 50%);
33
35
  box-shadow: inset 0 2px 5px 0 transparentize($color-dark, 0.8);
34
- display: block;
36
+ display: inline-block;
35
37
  height: $knob-size;
36
- margin: $spv-nudge-compensation 0 0 0;
38
+ margin: 0;
37
39
  position: relative;
38
40
  width: $knob-size * 2;
39
41
 
@@ -49,11 +51,9 @@ $knob-size: $sp-unit * 3;
49
51
  position: absolute;
50
52
  width: $knob-size;
51
53
  }
54
+ }
52
55
 
53
- // FIXME: we shouldn't be targeting span elements here
54
- // stylelint-disable-next-line selector-max-type
55
- & span {
56
- @extend %vf-hide-text;
57
- }
56
+ .p-switch__label {
57
+ margin-left: $sph--small;
58
58
  }
59
59
  }
@@ -59,7 +59,7 @@
59
59
  &[aria-label]::before {
60
60
  content: attr(aria-label);
61
61
  display: block;
62
- margin-bottom: map-get($sp-after, x-small) - map-get($nudges, nudge--x-small) - $sp-unit;
62
+ margin-bottom: map-get($sp-after, x-small) - map-get($nudges, x-small) - $sp-unit;
63
63
  overflow: hidden;
64
64
  padding-left: 0;
65
65
  padding-right: 0;
@@ -40,6 +40,7 @@ $color-focus-negative: #3b0006 !default;
40
40
  // Button background color changes
41
41
  $hover-background-opacity-amount: 0.05;
42
42
  $active-background-opacity-amount: 0.08;
43
+
43
44
  $muted-text-opacity-amount: 0.6;
44
45
  $inactive-text-opacity-amount: 0.75;
45
46
 
@@ -92,6 +93,23 @@ $colors--light-theme--border-default: rgba($color-x-dark, 0.15) !default;
92
93
  $colors--light-theme--border-high-contrast: rgba($color-x-dark, 0.56) !default;
93
94
  $colors--light-theme--border-low-contrast: rgba($color-x-dark, 0.1) !default;
94
95
 
96
+ //XXX: add dark theme versions of tinted background and border colours for use with dark theme chips, notificaitons, etc.
97
+ $colors-light-theme--tinted-backgrounds: (
98
+ neutral: #f2f2f2,
99
+ positive: #e8fdec,
100
+ caution: #fef1dc,
101
+ negative: #fce8ea,
102
+ information: #e5f2ff,
103
+ );
104
+
105
+ $colors-light-theme--tinted-borders: (
106
+ neutral: $colors--light-theme--border-high-contrast,
107
+ positive: $color-positive,
108
+ caution: #ec6c04,
109
+ negative: $color-negative,
110
+ information: $color-information,
111
+ );
112
+
95
113
  // Dark theme
96
114
  $colors--dark-theme--text-default: hsl(0, 0%, 100%) !default;
97
115
  $colors--dark-theme--text-hover: hsl(0, 0%, 76%) !default; // minimum contrast on primary that satisfies contrast checker AA
@@ -8,27 +8,26 @@ $sp-unit-ratio: 0.5 !default;
8
8
  $sp-unit: 1rem * $sp-unit-ratio !default;
9
9
 
10
10
  $font-sizes: (
11
- x-small: pow($ms-ratio, -2),
12
- small: pow($ms-ratio, -1),
13
- root: 1,
14
- h4-mobile: 1.22176,
15
- h4: pow($ms-ratio, 2),
16
- h3-mobile: pow($ms-ratio, 3),
17
- h3: pow($ms-ratio, 4),
18
- h2-mobile: 1.83274,
19
- h2: pow($ms-ratio, 6),
20
- h1-mobile: pow($ms-ratio, 6),
21
11
  h1: pow($ms-ratio, 8),
12
+ h1-mobile: pow($ms-ratio, 6),
13
+ h2: pow($ms-ratio, 6),
14
+ h2-mobile: 1.83274,
15
+ h3: pow($ms-ratio, 4),
16
+ h3-mobile: pow($ms-ratio, 3),
17
+ h4: pow($ms-ratio, 2),
18
+ h4-mobile: 1.22176,
19
+ small: pow($ms-ratio, -1),
20
+ x-small: pow($ms-ratio, -2),
22
21
  );
23
22
 
24
23
  $line-heights: (
25
24
  h1: 7 * $sp-unit,
26
- h2: 6 * $sp-unit,
27
- h3: 5 * $sp-unit,
28
- h4: 4 * $sp-unit,
29
25
  h1-mobile: 6 * $sp-unit,
26
+ h2: 6 * $sp-unit,
30
27
  h2-mobile: 5 * $sp-unit,
28
+ h3: 5 * $sp-unit,
31
29
  h3-mobile: 4 * $sp-unit,
30
+ h4: 4 * $sp-unit,
32
31
  h4-mobile: 3 * $sp-unit,
33
32
  default-text: 3 * $sp-unit,
34
33
  small: 2.5 * $sp-unit,
@@ -37,36 +36,36 @@ $line-heights: (
37
36
 
38
37
  // baseline nudges for type scale ratio of (16/14)^2
39
38
  $nudges: (
40
- nudge--h1-large: 0.15rem,
41
- nudge--h4-large: 0,
42
- nudge--h1: 0.2rem,
43
- nudge--h2: 0.2rem,
44
- nudge--h3: 0.1rem,
45
- nudge--h4: 0.05rem,
46
- nudge--h6: 0.338rem,
47
- nudge--h6-large: 0.345rem,
48
- nudge--h1-mobile: 0.165rem,
49
- nudge--h2-mobile: 0.1rem,
50
- nudge--h3-mobile: 0.5rem,
51
- nudge--h4-mobile: 0.3rem,
52
- nudge--p: 0.4rem,
53
- nudge--p-ubuntumono: 0.45rem,
54
- nudge--small: 0.05rem,
55
- nudge--x-small: 0.25rem,
39
+ h1-large: 0.15rem,
40
+ h1-mobile: 0.165rem,
41
+ h1: 0.2rem,
42
+ h2: 0.2rem,
43
+ h2-mobile: 0.1rem,
44
+ h3: 0.1rem,
45
+ h3-mobile: 0.5rem,
46
+ h4-large: 0,
47
+ h4: 0.05rem,
48
+ h4-mobile: 0.3rem,
49
+ h6: 0.338rem,
50
+ h6-large: 0.345rem,
51
+ p: 0.4rem,
52
+ p-ubuntumono: 0.45rem,
53
+ small: 0.05rem,
54
+ x-small: 0.25rem,
56
55
  ) !default;
57
56
 
58
57
  // Correct baseline drift due to browser rounding. (Visible in text > 1000 lines)
59
58
  // It is applied only to padding-top.
60
59
  $browser-rounding-compensations: (
61
- small: 0.0005rem,
62
- small-largescreen: 0.0006rem,
63
- p: 0.0005rem,
64
- h6: 0,
65
- h5: 0.001rem,
66
- h4: 0.001rem,
67
- h3: 0.001rem,
68
- h2: 0.001rem,
69
60
  h1: 0.001rem,
61
+ h2: 0.001rem,
62
+ h3: 0.001rem,
63
+ h4: 0.001rem,
64
+ h5: 0.001rem,
65
+ h6: 0,
66
+ p: 0.0005rem,
67
+ small-largescreen: 0.0006rem,
68
+ small: 0.0005rem,
70
69
  ) !default;
71
70
 
72
71
  // Main spacing variables. spv stands spacing-vertical; sph stands for spacing-horizontal.
@@ -79,6 +78,7 @@ $spv--x-large: $sp-unit * 3 !default;
79
78
  $spv--strip-regular: $sp-unit * 8 !default;
80
79
  $spv--strip-deep: $sp-unit * 12 !default;
81
80
 
81
+ $sph--x-small: $sp-unit * 0.5 !default; // to be used in place of an inline space between characters/words
82
82
  $sph--small: $sp-unit !default;
83
83
  $sph--large: $sp-unit * 2 !default;
84
84
  $sph--x-large: $sp-unit * 3 !default;
@@ -86,23 +86,23 @@ $sph--x-large: $sp-unit * 3 !default;
86
86
  // Space after text elements
87
87
  $sp-after: (
88
88
  h1: $spv--large,
89
+ h1-mobile: $spv--large,
89
90
  h2: $spv--large,
91
+ h2-mobile: $spv--large,
90
92
  h3: $spv--large,
93
+ h3-mobile: $spv--large,
91
94
  h4: $spv--large,
95
+ h4-mobile: $spv--large,
92
96
  p: $spv--x-large,
93
97
  p-dense: $spv--large,
94
- h1-mobile: $spv--large,
95
- h2-mobile: $spv--large,
96
- h3-mobile: $spv--large,
97
- h4-mobile: $spv--large,
98
+ default-text: $sp-unit,
98
99
  small: $spv--large,
99
100
  small--dense: $spv--large,
100
101
  x-small: $spv--large,
101
- default-text: $sp-unit,
102
102
  ) !default;
103
103
 
104
104
  // commonly occuring calculations available as variables
105
- $spv-nudge: map-get($nudges, nudge--p) !default; // top: nudge; bottom: unit - nudge; result: height = exact multiple of base unit
105
+ $spv-nudge: map-get($nudges, p) !default; // top: nudge; bottom: unit - nudge; result: height = exact multiple of base unit
106
106
  $spv-nudge-compensation: $sp-unit - $spv-nudge !default;
107
107
  $input-margin-bottom: $sp-unit * 4 - $spv-nudge * 2;
108
108
  $input-vertical-padding: calc(#{$spv-nudge} - 1px);
@@ -115,7 +115,7 @@ $form-tick-box-nudge: 0.15rem; // to nudge the tick box a bit below baseline (to
115
115
  $form-radio-inner-circle-diameter: 0.375rem;
116
116
  $form-radio-circle-offset: 0.5 * ($form-tick-box-size - $form-radio-inner-circle-diameter);
117
117
 
118
- $max-width--default: 40em !default;
118
+ $text-max-width: 40em !default;
119
119
 
120
120
  $icon-sizes: (
121
121
  accordion: $sp-unit * 1.5,
@@ -60,10 +60,10 @@
60
60
  }
61
61
 
62
62
  .u-align-text--small-to-default {
63
- padding-top: map-get($nudges, nudge--small) + $sp-unit;
63
+ padding-top: map-get($nudges, small) + $sp-unit;
64
64
  }
65
65
 
66
66
  .u-align-text--x-small-to-default {
67
- padding-top: map-get($nudges, nudge--x-small) + $sp-unit;
67
+ padding-top: map-get($nudges, x-small) + $sp-unit;
68
68
  }
69
69
  }