@stackoverflow/stacks 1.9.4 → 1.10.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/README.md +4 -3
- package/dist/css/stacks.css +89 -107
- package/dist/css/stacks.min.css +1 -1
- package/dist/js/stacks.js +33 -69
- package/lib/atomic/border.less +3 -3
- package/lib/atomic/misc.less +4 -4
- package/lib/atomic/typography.less +1 -1
- package/lib/base/body.less +1 -1
- package/lib/base/reset-normalize.less +3 -3
- package/lib/components/anchor/anchor.a11y.test.ts +42 -0
- package/lib/components/anchor/anchor.less +5 -2
- package/lib/components/anchor/anchor.visual.test.ts +53 -0
- package/lib/components/avatar/avatar.less +1 -1
- package/lib/components/banner/banner.less +10 -17
- package/lib/components/block-link/block-link.a11y.test.ts +7 -6
- package/lib/components/block-link/block-link.less +1 -1
- package/lib/components/block-link/block-link.visual.test.ts +7 -6
- package/lib/components/button/button.less +31 -46
- package/lib/components/card/card.visual.test.ts +7 -6
- package/lib/components/input-fill/input-fill.less +2 -2
- package/lib/components/input-icon/input-icon.less +1 -1
- package/lib/components/input_textarea/input_textarea.less +2 -2
- package/lib/components/link/link.a11y.test.ts +36 -0
- package/lib/components/link/link.less +1 -0
- package/lib/components/link/link.visual.test.ts +32 -0
- package/lib/components/navigation/navigation.less +1 -1
- package/lib/components/notice/notice.less +1 -1
- package/lib/components/page-title/page-title.less +1 -1
- package/lib/components/post-summary/post-summary.less +5 -1
- package/lib/components/select/select.less +2 -2
- package/lib/components/sidebar-widget/sidebar-widget.less +3 -3
- package/lib/components/spinner/spinner.less +1 -1
- package/lib/components/table/table.less +3 -3
- package/lib/components/toast/toast.test.ts +24 -23
- package/lib/components/topbar/topbar.less +6 -6
- package/lib/exports/constants-colors.less +19 -31
- package/lib/exports/constants-helpers.less +3 -3
- package/lib/exports/constants-type.less +5 -3
- package/package.json +28 -28
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// BASE COMPONENT-SPECIFIC CUSTOM PROPERTIES
|
|
3
3
|
--_bu-baw: var(--su-static1);
|
|
4
4
|
--_bu-bc: transparent;
|
|
5
|
-
--_bu-bg:
|
|
6
|
-
--_bu-br: var(--br-
|
|
7
|
-
--_bu-bs: none;
|
|
5
|
+
// --_bu-bg: inherit; // [1]
|
|
6
|
+
--_bu-br: var(--br-md);
|
|
8
7
|
--_bu-fc: var(--theme-button-color);
|
|
9
8
|
--_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
10
9
|
--_bu-fs: var(--fs-body1);
|
|
@@ -18,14 +17,13 @@
|
|
|
18
17
|
--_bu-fc-hover: var(--theme-button-hover-color);
|
|
19
18
|
--_bu-fc-selected: var(--theme-button-selected-color);
|
|
20
19
|
// Filled
|
|
21
|
-
--_bu-filled-bc:
|
|
22
|
-
--_bu-filled-bc-active:
|
|
20
|
+
--_bu-filled-bc: transparent;
|
|
21
|
+
--_bu-filled-bc-active: transparent;
|
|
23
22
|
--_bu-filled-bg-hover: var(--theme-button-filled-hover-background-color);
|
|
24
|
-
--_bu-filled-bc-selected:
|
|
23
|
+
--_bu-filled-bc-selected: transparent;
|
|
25
24
|
--_bu-filled-bg: var(--theme-button-filled-background-color);
|
|
26
25
|
--_bu-filled-bg-active: var(--theme-button-filled-active-background-color);
|
|
27
26
|
--_bu-filled-bg-selected: var(--theme-button-filled-selected-background-color);
|
|
28
|
-
--_bu-filled-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0, 100%, 0.7);
|
|
29
27
|
--_bu-filled-fc: var(--theme-button-filled-color);
|
|
30
28
|
--_bu-filled-fc-active: var(--theme-button-filled-hover-color); // Note: hover color used here intentionally
|
|
31
29
|
--_bu-filled-fc-hover: var(--theme-button-filled-hover-color);
|
|
@@ -43,11 +41,6 @@
|
|
|
43
41
|
--_bu-number-fc-selected: var(--_bu-number-fc);
|
|
44
42
|
|
|
45
43
|
// CONTEXTUAL STYLES
|
|
46
|
-
.dark-mode({
|
|
47
|
-
--_bu-bs: none;
|
|
48
|
-
--_bu-filled-bs: var(--_bu-bs);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
44
|
.highcontrast-mode({
|
|
52
45
|
--_bu-bc: currentColor;
|
|
53
46
|
--_bu-filled-bc: var(--_bu-bc);
|
|
@@ -65,8 +58,6 @@
|
|
|
65
58
|
fieldset[disabled] &,
|
|
66
59
|
&[disabled],
|
|
67
60
|
&[aria-disabled="true"] {
|
|
68
|
-
--_bu-bs: none !important;
|
|
69
|
-
--_bu-filled-bs: var(--_bu-bs);
|
|
70
61
|
opacity: var(--_o-disabled-static);
|
|
71
62
|
pointer-events: none;
|
|
72
63
|
text-decoration: none;
|
|
@@ -75,7 +66,7 @@
|
|
|
75
66
|
button &,
|
|
76
67
|
button[type="submit"] &,
|
|
77
68
|
button[type="reset"] & {
|
|
78
|
-
-webkit-appearance: button; // [
|
|
69
|
+
-webkit-appearance: button; // [2]
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
&.grid {
|
|
@@ -84,8 +75,8 @@
|
|
|
84
75
|
|
|
85
76
|
&.is-loading {
|
|
86
77
|
.svg-icon:first-child {
|
|
87
|
-
margin-left: -23px
|
|
88
|
-
opacity: 0; // [
|
|
78
|
+
margin-left: calc((var(--su-static24) - var(--su-static1)) * -1); // -23px
|
|
79
|
+
opacity: 0; // [3]
|
|
89
80
|
}
|
|
90
81
|
|
|
91
82
|
padding-left: 2.2em;
|
|
@@ -122,22 +113,16 @@
|
|
|
122
113
|
}
|
|
123
114
|
}
|
|
124
115
|
|
|
125
|
-
&.is-selected:not(:focus),
|
|
126
|
-
.s-btn-group.s-btn-group--radio &--radio:checked:not(:focus) + & {
|
|
127
|
-
box-shadow: none;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
116
|
// MODIFIERS
|
|
131
117
|
&&__filled {
|
|
132
118
|
border-color: var(--_bu-filled-bc);
|
|
133
119
|
background-color: var(--_bu-filled-bg);
|
|
134
|
-
box-shadow: var(--_bu-filled-bs);
|
|
135
120
|
color: var(--_bu-filled-fc);
|
|
136
121
|
}
|
|
137
122
|
|
|
138
123
|
&&__outlined {
|
|
139
124
|
border-color: var(--_bu-outlined-bc);
|
|
140
|
-
background-color: var(--_bu-outlined-bg);
|
|
125
|
+
background-color: var(--_bu-outlined-bg, inherit);
|
|
141
126
|
}
|
|
142
127
|
|
|
143
128
|
// Resets
|
|
@@ -152,8 +137,6 @@
|
|
|
152
137
|
&&__link {
|
|
153
138
|
--_bu-baw: 0;
|
|
154
139
|
--_bu-br: 0;
|
|
155
|
-
--_bu-bs: none;
|
|
156
|
-
--_bu-filled-bs: var(--_bu-bs);
|
|
157
140
|
--_bu-focus-ring: none;
|
|
158
141
|
--_bu-p: 0;
|
|
159
142
|
|
|
@@ -185,8 +168,6 @@
|
|
|
185
168
|
--_bu-baw: 0;
|
|
186
169
|
--_bu-bg: none;
|
|
187
170
|
--_bu-br: 0;
|
|
188
|
-
--_bu-bs: none;
|
|
189
|
-
--_bu-filled-bs: var(--_bu-bs);
|
|
190
171
|
--_bu-fc: unset;
|
|
191
172
|
--_bu-focus-ring: none;
|
|
192
173
|
--_bu-p: 0;
|
|
@@ -220,8 +201,8 @@
|
|
|
220
201
|
&&__icon {
|
|
221
202
|
.svg-icon {
|
|
222
203
|
vertical-align: baseline;
|
|
223
|
-
margin-top: -0.3em; // [
|
|
224
|
-
margin-bottom: -0.3em; // [
|
|
204
|
+
margin-top: -0.3em; // [4]
|
|
205
|
+
margin-bottom: -0.3em; // [4]
|
|
225
206
|
transition: opacity 200ms var(--te-smooth); // Animate the transition to .is-loading
|
|
226
207
|
}
|
|
227
208
|
}
|
|
@@ -265,7 +246,6 @@
|
|
|
265
246
|
--_bu-filled-bg-active: var(--red-700);
|
|
266
247
|
--_bu-filled-bg-hover: var(--red-600);
|
|
267
248
|
--_bu-filled-bg-selected: var(--red-800);
|
|
268
|
-
--_bu-filled-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.4);
|
|
269
249
|
--_bu-filled-fc: var(--white);
|
|
270
250
|
--_bu-filled-fc-active: var(--_bu-filled-fc);
|
|
271
251
|
--_bu-filled-fc-hover: var(--_bu-filled-fc);
|
|
@@ -297,29 +277,32 @@
|
|
|
297
277
|
--_bu-bg-active: var(--black-050);
|
|
298
278
|
--_bu-bg-hover: var(--black-025);
|
|
299
279
|
--_bu-bg-selected: var(--black-075);
|
|
300
|
-
--_bu-fc: var(--black-
|
|
280
|
+
--_bu-fc: var(--black-700);
|
|
301
281
|
--_bu-fc-active: var(--_bu-fc);
|
|
302
|
-
--_bu-fc-hover: var(--black-
|
|
282
|
+
--_bu-fc-hover: var(--black-700);
|
|
303
283
|
--_bu-fc-selected: var(--black-700);
|
|
304
284
|
--_bu-focus-ring: 0 0 0 var(--su-static4) var(--focus-ring-muted);
|
|
285
|
+
// The filled modifier on the muted button is deprecated and is to be
|
|
286
|
+
// removed in Stacks Classic v2
|
|
305
287
|
--_bu-filled-bc: transparent;
|
|
306
288
|
--_bu-filled-bc-selected: var(--_bu-filled-bc);
|
|
307
289
|
--_bu-filled-bg: var(--black-100);
|
|
308
290
|
--_bu-filled-bg-active: var(--black-200);
|
|
309
291
|
--_bu-filled-bg-hover: var(--black-150);
|
|
310
292
|
--_bu-filled-bg-selected: var(--black-350);
|
|
311
|
-
--_bu-filled-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.4);
|
|
312
293
|
--_bu-filled-fc: var(--black-700);
|
|
313
294
|
--_bu-filled-fc-active: var(--_bu-filled-fc);
|
|
314
295
|
--_bu-filled-fc-hover: var(--_bu-filled-fc);
|
|
315
296
|
--_bu-filled-fc-selected: var(--black-800);
|
|
316
|
-
--_bu-outlined-bc: var(--black-
|
|
317
|
-
--_bu-outlined-bc-selected: var(--black-
|
|
297
|
+
--_bu-outlined-bc: var(--black-200);
|
|
298
|
+
--_bu-outlined-bc-selected: var(--black-200);
|
|
318
299
|
--_bu-outlined-bg-selected: var(--_bu-bg-selected);
|
|
319
300
|
--_bu-outlined-fc-selected: var(--_bu-fc-selected);
|
|
320
301
|
|
|
321
302
|
.highcontrast-mode({
|
|
322
303
|
--_bu-bg-hover: var(--black-100);
|
|
304
|
+
// The filled modifier on the muted button is deprecated and is to be
|
|
305
|
+
// removed in Stacks Classic v2
|
|
323
306
|
--_bu-filled-bg: var(--black-400);
|
|
324
307
|
--_bu-filled-bg-active: var(--black-600);
|
|
325
308
|
--_bu-filled-bg-hover: var(--black-500);
|
|
@@ -338,7 +321,6 @@
|
|
|
338
321
|
--_bu-bg-active: var(--theme-button-primary-active-background-color);
|
|
339
322
|
--_bu-bg-hover: var(--theme-button-primary-hover-background-color);
|
|
340
323
|
--_bu-bg-selected: var(--theme-button-primary-selected-background-color);
|
|
341
|
-
--_bu-bs: inset 0 1px 0 0 hsla(0, 0%, 100%, 0.4);
|
|
342
324
|
--_bu-fc: var(--theme-button-primary-color);
|
|
343
325
|
--_bu-fc-active: var(--theme-button-primary-hover-color);
|
|
344
326
|
--_bu-fc-hover: var(--theme-button-primary-hover-color);
|
|
@@ -430,14 +412,14 @@
|
|
|
430
412
|
&--radio { // This lives alongside a .s-btn element. These styles are the equivelent of `.v-visible-sr`
|
|
431
413
|
border: 0;
|
|
432
414
|
clip-path: inset(50%);
|
|
433
|
-
clip: rect(1px, 1px, 1px, 1px)
|
|
434
|
-
height:
|
|
435
|
-
margin: -1px
|
|
415
|
+
clip: rect(var(--su-static1), var(--su-static1), var(--su-static1), var(--su-static1)); // rect(1px, 1px, 1px, 1px)
|
|
416
|
+
height: var(--su-static1);
|
|
417
|
+
margin: calc(var(--su-static1) * -1); // -1px
|
|
436
418
|
overflow-wrap: normal;
|
|
437
419
|
overflow: hidden;
|
|
438
420
|
padding: 0;
|
|
439
421
|
position: absolute;
|
|
440
|
-
width:
|
|
422
|
+
width: var(--su-static1);
|
|
441
423
|
}
|
|
442
424
|
|
|
443
425
|
// INTERACTION
|
|
@@ -479,10 +461,10 @@
|
|
|
479
461
|
outline: none;
|
|
480
462
|
}
|
|
481
463
|
|
|
482
|
-
background-color: var(--_bu-bg);
|
|
464
|
+
background-color: var(--_bu-bg, inherit); // [1]
|
|
483
465
|
border: var(--_bu-baw) solid var(--_bu-bc);
|
|
484
466
|
border-radius: var(--_bu-br);
|
|
485
|
-
box-shadow:
|
|
467
|
+
box-shadow: none;
|
|
486
468
|
color: var(--_bu-fc);
|
|
487
469
|
font-size: var(--_bu-fs);
|
|
488
470
|
padding: var(--_bu-p);
|
|
@@ -499,11 +481,14 @@
|
|
|
499
481
|
user-select: none;
|
|
500
482
|
}
|
|
501
483
|
|
|
502
|
-
// [1]
|
|
484
|
+
// [1] Passing `inherit` as a custom property value has no effect, instead we
|
|
485
|
+
// provide it as a fallback value for when --_bu-bg is not defined
|
|
486
|
+
// For more info, see https://stackoverflow.com/a/53239881/652353
|
|
487
|
+
// [2] Guard against the difference in configurable resets
|
|
503
488
|
// Eric Meyer's reset does not include this, while normalize.css does
|
|
504
489
|
// Correct the inability to style buttons in iOS and Safari.
|
|
505
|
-
// [
|
|
490
|
+
// [3] If the first thing in the button is an icon, let's hide it on loading
|
|
506
491
|
// We only want to modify the visibility, since we still want it to have shape and keep the same layout.
|
|
507
|
-
// [
|
|
492
|
+
// [4] Most svg icons are 18px tall, but the button's line-height is 1 (13px).
|
|
508
493
|
// This means we need to off set the margin y-axis so we don't add
|
|
509
494
|
// additional height to the button.
|
|
@@ -3,12 +3,13 @@ import { defaultOptions, runComponentTests } from "../../test/test-utils";
|
|
|
3
3
|
import "../../index";
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
-
const cardTemplate = ({ component, testid }: any) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const cardTemplate = ({ component, testid }: any) =>
|
|
7
|
+
html`<div
|
|
8
|
+
class="d-inline-flex ai-center jc-center hs2 ws3 p8"
|
|
9
|
+
data-testid="${testid}"
|
|
10
|
+
>
|
|
11
|
+
${component}
|
|
12
|
+
</div>`;
|
|
12
13
|
|
|
13
14
|
const baseChild = `
|
|
14
15
|
<h2 class="fs-body3 lh-sm fc-dark">Base card title</h2>
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
&.order-first {
|
|
15
15
|
--_if-blw: var(--su-static1);
|
|
16
|
-
--_if-blr: var(--br-
|
|
16
|
+
--_if-blr: var(--br-md);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
&.order-last {
|
|
20
20
|
--_if-brw: var(--su-static1);
|
|
21
|
-
--_if-brr: var(--br-
|
|
21
|
+
--_if-brr: var(--br-md);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
background-color: var(--_if-bg);
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
color: var(--_ii-fc);
|
|
39
39
|
right: var(--_ii-r);
|
|
40
40
|
|
|
41
|
-
margin-top: -
|
|
41
|
+
margin-top: calc((var(--su-static8) + var(--su-static1)) * -1); // -9px - Half the icon's height at 18px for centering;
|
|
42
42
|
pointer-events: none;
|
|
43
43
|
position: absolute;
|
|
44
44
|
top: 50%;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
--_in-bc: var(--bc-darker);
|
|
4
4
|
--_in-bc-focus: var(--theme-secondary-300);
|
|
5
5
|
--_in-bg: var(--white);
|
|
6
|
-
--_in-br: var(--br-
|
|
6
|
+
--_in-br: var(--br-md);
|
|
7
7
|
--_in-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
8
8
|
--_in-c: unset;
|
|
9
9
|
--_in-fc: var(--fc-dark);
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
&&__md {
|
|
71
71
|
@supports (-webkit-overflow-scrolling: touch) {
|
|
72
|
-
--_in-fs: 17px
|
|
72
|
+
--_in-fs: calc(var(--su-static16) + var(--su-static1)); // 17px
|
|
73
73
|
--_in-py: 0.4em;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { runComponentTests } from "../../test/test-utils";
|
|
2
|
+
import "../../index";
|
|
3
|
+
|
|
4
|
+
describe("link", () => {
|
|
5
|
+
// TODO check for visited styling
|
|
6
|
+
runComponentTests({
|
|
7
|
+
type: "a11y",
|
|
8
|
+
baseClass: "s-link",
|
|
9
|
+
modifiers: {
|
|
10
|
+
primary: [
|
|
11
|
+
"grayscale",
|
|
12
|
+
"muted",
|
|
13
|
+
"danger",
|
|
14
|
+
"inherit",
|
|
15
|
+
"underlined",
|
|
16
|
+
"visited",
|
|
17
|
+
],
|
|
18
|
+
secondary: ["dropdown"],
|
|
19
|
+
},
|
|
20
|
+
children: {
|
|
21
|
+
default: "s-link",
|
|
22
|
+
},
|
|
23
|
+
tag: "a",
|
|
24
|
+
attributes: {
|
|
25
|
+
href: "#",
|
|
26
|
+
},
|
|
27
|
+
skippedTestids: [
|
|
28
|
+
"s-link-dark", // TODO fix contrast issue
|
|
29
|
+
"s-link-dark-dropdown", // TODO fix contrast issue
|
|
30
|
+
"s-link-dark-danger", // TODO fix contrast issue
|
|
31
|
+
"s-link-dark-danger-dropdown", // TODO fix contrast issue
|
|
32
|
+
"s-link-dark-underlined", // TODO fix contrast issue
|
|
33
|
+
"s-link-dark-underlined-dropdown", // TODO fix contrast issue
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -53,6 +53,7 @@ a,
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&__visited { // TODO can we get rid of this? It's only in 3 places in Core and seems to me it doesn't even serve a purpose.
|
|
56
|
+
--_li-fc: var(--theme-link-color-visited);
|
|
56
57
|
--_li-fc-hover: var(--theme-link-color-hover);
|
|
57
58
|
--_li-fc-visited: var(--theme-link-color-visited);
|
|
58
59
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html } from "@open-wc/testing";
|
|
2
|
+
import { runComponentTests } from "../../test/test-utils";
|
|
3
|
+
import "../../index";
|
|
4
|
+
|
|
5
|
+
describe("link", () => {
|
|
6
|
+
// TODO check for visited styling
|
|
7
|
+
runComponentTests({
|
|
8
|
+
type: "visual",
|
|
9
|
+
baseClass: "s-link",
|
|
10
|
+
modifiers: {
|
|
11
|
+
primary: [
|
|
12
|
+
"grayscale",
|
|
13
|
+
"muted",
|
|
14
|
+
"danger",
|
|
15
|
+
"inherit",
|
|
16
|
+
"underlined",
|
|
17
|
+
"visited",
|
|
18
|
+
],
|
|
19
|
+
secondary: ["dropdown"],
|
|
20
|
+
},
|
|
21
|
+
children: {
|
|
22
|
+
default: "s-link",
|
|
23
|
+
},
|
|
24
|
+
tag: "a",
|
|
25
|
+
attributes: {
|
|
26
|
+
href: "#",
|
|
27
|
+
},
|
|
28
|
+
template: ({ component, testid }) => html`
|
|
29
|
+
<div data-testid="${testid}" class="p4 ws1">${component}</div>
|
|
30
|
+
`,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -274,11 +274,15 @@
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
&--meta {
|
|
277
|
-
> *:not(.s-post-summary--meta-tags) > * {
|
|
277
|
+
> *:not(.s-post-summary--meta-tags):not(.s-user-card) > * {
|
|
278
278
|
opacity: var(--_ps-o);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
.s-user-card {
|
|
282
|
+
> *:not(.magic-popup) {
|
|
283
|
+
opacity: var(--_ps-o);
|
|
284
|
+
}
|
|
285
|
+
|
|
282
286
|
flex-wrap: wrap;
|
|
283
287
|
justify-content: flex-end;
|
|
284
288
|
margin-left: auto;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
--_se-select-bc-focus: var(--theme-secondary-300);
|
|
6
6
|
--_se-select-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
7
7
|
--_se-select-bg: var(--white);
|
|
8
|
-
--_se-select-br: var(--br-
|
|
8
|
+
--_se-select-br: var(--br-md);
|
|
9
9
|
--_se-select-fc: var(--black);
|
|
10
10
|
--_se-select-px: 0.7em;
|
|
11
11
|
--_se-select-py: 0.6em;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
// CONTEXTUAL STYLES
|
|
15
15
|
@supports (-webkit-overflow-scrolling: touch) {
|
|
16
|
-
--_se-select-fs:
|
|
16
|
+
--_se-select-fs: var(--su-static16); // Increase font size for mobile safari. This keeps our inputs from zooming the page while focused
|
|
17
17
|
--_se-select-px: 0.55em; // Compensate for the larger font size so we generally keep the input the same size
|
|
18
18
|
--_se-select-py: 0.4em; // Compensate for the larger font size so we generally keep the input the same size
|
|
19
19
|
}
|
|
@@ -159,9 +159,9 @@
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
#stacks-internals #bullet-arrow(var(--black-100));
|
|
162
|
-
background-position: 0 calc((1.2em -
|
|
162
|
+
background-position: 0 calc((1.2em - calc(var(--su-static8) + var(--su-static2))) / 2); // 0 ((1.2em - 10) / 2)
|
|
163
163
|
background-repeat: no-repeat;
|
|
164
|
-
background-size: auto 10px
|
|
164
|
+
background-size: auto calc(var(--su-static8) + var(--su-static2)); // auto 10px
|
|
165
165
|
margin-top: var(--su-static12);
|
|
166
166
|
padding-left: var(--su-static16);
|
|
167
167
|
}
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%); // [3]
|
|
198
198
|
content: '';
|
|
199
199
|
// TODO: this makes no sense. revisit.
|
|
200
|
-
height: calc(
|
|
200
|
+
height: calc(var(--su-static2) + var(--br-sm)); // we need 2px border + 2px border radius to have the correct corner shape
|
|
201
201
|
left: calc(var(--su-static1) * -1); // -1px
|
|
202
202
|
pointer-events: none; // if the top item is clickable, then we don't want to prevent clicking the top 2 pixels
|
|
203
203
|
position: absolute;
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
&.s-table--bulk {
|
|
208
|
-
--_ta-td-w: calc(var(--su32) - var(--su2)); // 30px
|
|
208
|
+
--_ta-td-w: calc(var(--su32) - var(--su2)); // 30px
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
&.s-table--progress {
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
&.s-table--progress-bar {
|
|
217
217
|
--_ta-td-blw: 0;
|
|
218
218
|
--_ta-td-pl: 0;
|
|
219
|
-
--_ta-td-w: 120px
|
|
219
|
+
--_ta-td-w: calc(var(--su-static12) * 10); // 120px
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
border: var(--su-static1) solid var(--_ta-td-bc);
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
&.s-table--bulk {
|
|
255
|
-
--_ta-th-w: calc(var(--su32) - var(--su2)); // 30px
|
|
255
|
+
--_ta-th-w: calc(var(--su32) - var(--su2)); // 30px
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
border: var(--su-static1) solid var(--_ta-th-bc);
|
|
@@ -6,29 +6,30 @@ import { showToast, hideToast } from "../../controllers";
|
|
|
6
6
|
|
|
7
7
|
const user = userEvent.setup();
|
|
8
8
|
|
|
9
|
-
const testToast = (hidden = true) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
const testToast = (hidden = true) =>
|
|
10
|
+
html` <button
|
|
11
|
+
class="js-open-test-toast"
|
|
12
|
+
data-toggle="s-toast"
|
|
13
|
+
data-target="#test-toast"
|
|
14
|
+
>
|
|
15
|
+
Show test toast
|
|
16
|
+
</button>
|
|
17
|
+
<button type="button" aria-label="Dismiss">Close toast</button>
|
|
18
|
+
<div
|
|
19
|
+
role="alertdialog"
|
|
20
|
+
id="test-toast"
|
|
21
|
+
class="s-toast"
|
|
22
|
+
aria-hidden="${hidden}"
|
|
23
|
+
aria-labelledby="toast-message"
|
|
24
|
+
data-controller="s-toast"
|
|
25
|
+
data-s-toast-target="toast"
|
|
26
|
+
data-s-toast-return-element=".js-open-test-toast[data-target='#test-toast']"
|
|
27
|
+
data-testid="test-toast"
|
|
28
|
+
>
|
|
29
|
+
<aside class="s-notice s-notice__success">
|
|
30
|
+
<div id="notice-message">Test toast</div>
|
|
31
|
+
</aside>
|
|
32
|
+
</div>`;
|
|
32
33
|
|
|
33
34
|
describe("toast", () => {
|
|
34
35
|
it("trigger should make toast visible", async () => {
|
|
@@ -89,14 +89,14 @@
|
|
|
89
89
|
position: absolute;
|
|
90
90
|
content: '';
|
|
91
91
|
left: 0;
|
|
92
|
-
top: -5px
|
|
92
|
+
top: calc(var(--su-static1) - var(--su-static6)); // -5px
|
|
93
93
|
transition: top, transform;
|
|
94
94
|
transition-duration: 0.1s;
|
|
95
95
|
transition-timing-function: ease-in-out;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
&:after {
|
|
99
|
-
top: 5px
|
|
99
|
+
top: calc(var(--su-static6) - var(--su-static1)); // 5px
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
outline: none;
|
|
287
287
|
|
|
288
288
|
.s-activity-indicator {
|
|
289
|
-
top: calc(50% -
|
|
289
|
+
top: calc(50% - calc(var(--su16) + var(--su2))); // 50% - 18px
|
|
290
290
|
box-shadow: 0 0 0 var(--su-static2) var(--theme-topbar-item-background-hover);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
@@ -297,8 +297,8 @@
|
|
|
297
297
|
|
|
298
298
|
.s-activity-indicator {
|
|
299
299
|
position: absolute;
|
|
300
|
-
top: calc(50% -
|
|
301
|
-
right:
|
|
300
|
+
top: calc(50% - calc(var(--su12) + var(--su2))); // 50% - 14px
|
|
301
|
+
right: var(--su-static2);
|
|
302
302
|
transition: top var(--te-smooth) 0.15s;
|
|
303
303
|
box-shadow: 0 0 0 var(--su-static2) var(--theme-topbar-background-color);
|
|
304
304
|
}
|
|
@@ -385,7 +385,7 @@
|
|
|
385
385
|
.wmx2;
|
|
386
386
|
|
|
387
387
|
align-self: stretch;
|
|
388
|
-
margin-right: -1px
|
|
388
|
+
margin-right: calc(var(--su-static1) * -1); //-1px
|
|
389
389
|
color: var(--theme-topbar-select-color);
|
|
390
390
|
|
|
391
391
|
&:before,
|