@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.
Files changed (39) hide show
  1. package/README.md +4 -3
  2. package/dist/css/stacks.css +89 -107
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +33 -69
  5. package/lib/atomic/border.less +3 -3
  6. package/lib/atomic/misc.less +4 -4
  7. package/lib/atomic/typography.less +1 -1
  8. package/lib/base/body.less +1 -1
  9. package/lib/base/reset-normalize.less +3 -3
  10. package/lib/components/anchor/anchor.a11y.test.ts +42 -0
  11. package/lib/components/anchor/anchor.less +5 -2
  12. package/lib/components/anchor/anchor.visual.test.ts +53 -0
  13. package/lib/components/avatar/avatar.less +1 -1
  14. package/lib/components/banner/banner.less +10 -17
  15. package/lib/components/block-link/block-link.a11y.test.ts +7 -6
  16. package/lib/components/block-link/block-link.less +1 -1
  17. package/lib/components/block-link/block-link.visual.test.ts +7 -6
  18. package/lib/components/button/button.less +31 -46
  19. package/lib/components/card/card.visual.test.ts +7 -6
  20. package/lib/components/input-fill/input-fill.less +2 -2
  21. package/lib/components/input-icon/input-icon.less +1 -1
  22. package/lib/components/input_textarea/input_textarea.less +2 -2
  23. package/lib/components/link/link.a11y.test.ts +36 -0
  24. package/lib/components/link/link.less +1 -0
  25. package/lib/components/link/link.visual.test.ts +32 -0
  26. package/lib/components/navigation/navigation.less +1 -1
  27. package/lib/components/notice/notice.less +1 -1
  28. package/lib/components/page-title/page-title.less +1 -1
  29. package/lib/components/post-summary/post-summary.less +5 -1
  30. package/lib/components/select/select.less +2 -2
  31. package/lib/components/sidebar-widget/sidebar-widget.less +3 -3
  32. package/lib/components/spinner/spinner.less +1 -1
  33. package/lib/components/table/table.less +3 -3
  34. package/lib/components/toast/toast.test.ts +24 -23
  35. package/lib/components/topbar/topbar.less +6 -6
  36. package/lib/exports/constants-colors.less +19 -31
  37. package/lib/exports/constants-helpers.less +3 -3
  38. package/lib/exports/constants-type.less +5 -3
  39. 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: transparent;
6
- --_bu-br: var(--br-sm);
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: var(--theme-button-filled-border-color);
22
- --_bu-filled-bc-active: var(--theme-button-filled-active-border-color);
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: var(--theme-button-filled-selected-border-color);
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; // [1]
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; // [2]
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; // [3]
224
- margin-bottom: -0.3em; // [3]
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-500);
280
+ --_bu-fc: var(--black-700);
301
281
  --_bu-fc-active: var(--_bu-fc);
302
- --_bu-fc-hover: var(--black-600);
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-300);
317
- --_bu-outlined-bc-selected: var(--black-400);
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: 1px;
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: 1px;
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: var(--_bu-bs);
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] Guard against the difference in configurable resets
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
- // [2] If the first thing in the button is an icon, let's hide it on loading
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
- // [3] Most svg icons are 18px tall, but the button's line-height is 1 (13px).
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) => html`<div
7
- class="d-inline-flex ai-center jc-center hs2 ws3 p8"
8
- data-testid="${testid}"
9
- >
10
- ${component}
11
- </div>`;
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-sm);
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-sm);
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: -9px; // Half the icon's height at 18px for centering;
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-sm);
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
+ });
@@ -78,7 +78,7 @@
78
78
  pointer-events: none;
79
79
  position: absolute;
80
80
  right: 0.9em;
81
- top: calc(50% - 2px);
81
+ top: calc(50% - var(--su-static2)); // 50% - 2px
82
82
  z-index: var(--zi-active);
83
83
  }
84
84
 
@@ -197,7 +197,7 @@
197
197
  .s-notice {
198
198
  .construct-notice-component(s-notice);
199
199
 
200
- border-radius: var(--br-sm);
200
+ border-radius: var(--br-md);
201
201
  border-width: var(--su-static1);
202
202
  padding: var(--su16);
203
203
  }
@@ -43,7 +43,7 @@
43
43
  align-items: var(--_pt-ai);
44
44
  flex-direction: var(--_pt-fd);
45
45
 
46
- border-bottom: 1px solid var(--bc-medium);
46
+ border-bottom: var(--su-static1) solid var(--bc-medium);
47
47
  display: flex;
48
48
  justify-content: space-between;
49
49
  padding-bottom: var(--su16);
@@ -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-sm);
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: 16px; // Increase font size for mobile safari. This keeps our inputs from zooming the page while focused
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 - 10px) / 2);
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(2px + var(--br-sm)); // we need 2px border + 2px border radius to have the correct corner shape
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;
@@ -76,7 +76,7 @@
76
76
  border-color: transparent;
77
77
  border-left-color: currentColor;
78
78
  filter: invert(0); // [1]
79
- transform-origin: 50% 50% 1px; // [1]
79
+ transform-origin: 50% 50% var(--su-static1); // [1]
80
80
  }
81
81
 
82
82
  &:before {
@@ -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) => html` <button
10
- class="js-open-test-toast"
11
- data-toggle="s-toast"
12
- data-target="#test-toast"
13
- >
14
- Show test toast
15
- </button>
16
- <button type="button" aria-label="Dismiss">Close toast</button>
17
- <div
18
- role="alertdialog"
19
- id="test-toast"
20
- class="s-toast"
21
- aria-hidden="${hidden}"
22
- aria-labelledby="toast-message"
23
- data-controller="s-toast"
24
- data-s-toast-target="toast"
25
- data-s-toast-return-element=".js-open-test-toast[data-target='#test-toast']"
26
- data-testid="test-toast"
27
- >
28
- <aside class="s-notice s-notice__success">
29
- <div id="notice-message">Test toast</div>
30
- </aside>
31
- </div>`;
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% - 18px);
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% - 14px);
301
- right: 2px;
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,