@stackoverflow/stacks 2.0.0-rc.9 → 2.0.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 (31) hide show
  1. package/dist/css/stacks.css +194 -159
  2. package/dist/css/stacks.min.css +1 -1
  3. package/lib/atomic/typography.less +2 -2
  4. package/lib/components/activity-indicator/activity-indicator.less +1 -1
  5. package/lib/components/badge/badge.less +10 -10
  6. package/lib/components/checkbox_radio/checkbox_radio.less +14 -8
  7. package/lib/components/code-block/code-block.a11y.test.ts +1 -1
  8. package/lib/components/input_textarea/input_textarea.a11y.test.ts +112 -0
  9. package/lib/components/input_textarea/input_textarea.visual.test.ts +98 -0
  10. package/lib/components/label/label.less +1 -1
  11. package/lib/components/link-preview/link-preview.less +2 -2
  12. package/lib/components/modal/modal.less +1 -0
  13. package/lib/components/navigation/navigation.a11y.test.ts +0 -2
  14. package/lib/components/page-title/page-title.a11y.test.ts +29 -0
  15. package/lib/components/page-title/page-title.visual.test.ts +59 -0
  16. package/lib/components/post-summary/post-summary.less +5 -5
  17. package/lib/components/tag/tag.a11y.test.ts +29 -0
  18. package/lib/components/tag/tag.less +7 -1
  19. package/lib/components/tag/tag.visual.test.ts +46 -0
  20. package/lib/components/toggle-switch/toggle-switch.less +8 -1
  21. package/lib/components/topbar/topbar.less +30 -14
  22. package/lib/components/uploader/uploader.less +1 -1
  23. package/lib/components/user-card/user-card.less +2 -2
  24. package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +62 -62
  25. package/lib/exports/__snapshots__/color.less.test.ts.snap +79 -79
  26. package/lib/exports/color-mixins.less +15 -12
  27. package/lib/exports/color-sets.less +23 -23
  28. package/lib/exports/mixins.less +3 -14
  29. package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +28 -28
  30. package/lib/test/test-utils.ts +1 -3
  31. package/package.json +7 -7
@@ -56,7 +56,7 @@ p {
56
56
  }, @force-selector: true);
57
57
 
58
58
  .fs-category {
59
- font-weight: 600;
59
+ font-weight: 700;
60
60
  text-transform: uppercase;
61
61
 
62
62
  // If a top border is desired
@@ -89,7 +89,7 @@ p {
89
89
 
90
90
  // -- Font Weight
91
91
  .fw-normal { font-weight: 400 !important; }
92
- .fw-bold { font-weight: 600 !important; }
92
+ .fw-bold { font-weight: 700 !important; }
93
93
 
94
94
  // -- Font Styles
95
95
  .fs-normal { font-style: normal !important; }
@@ -44,7 +44,7 @@
44
44
  border-radius: 1000px;
45
45
  display: inline-block;
46
46
  font-size: var(--fs-fine);
47
- font-weight: 600;
47
+ font-weight: 700;
48
48
  line-height: 1.1; // Custom line-height to satisfy 1x screens
49
49
  min-width: var(--su-static12);
50
50
  min-height: var(--su-static12);
@@ -13,17 +13,17 @@
13
13
  // CONTEXTUAL STYLES
14
14
  .highcontrast-mode({
15
15
  // Badge counts
16
- &&__gold,
17
- &&__silver,
18
- &&__bronze,
16
+ &__gold,
17
+ &__silver,
18
+ &__bronze,
19
19
  // Number counts
20
- &&__rep,
21
- &&__rep-down,
22
- &&__votes:not(&__answered),
20
+ &__rep,
21
+ &__rep-down,
22
+ &__votes:not(.s-badge__answered),
23
23
  // Users
24
- &&__admin,
25
- &&__moderator,
26
- &&__staff {
24
+ &__admin,
25
+ &__moderator,
26
+ &__staff {
27
27
  --_ba-bc: currentColor;
28
28
  }
29
29
  });
@@ -113,7 +113,7 @@
113
113
 
114
114
  // Users
115
115
  &&__admin {
116
- --_ba-bc: var(--theme-primary-300);
116
+ --_ba-bc: var(--theme-primary-200);
117
117
  --_ba-bg: var(--theme-primary-100);
118
118
  --_ba-fc: var(--theme-primary-500);
119
119
  }
@@ -47,8 +47,20 @@
47
47
  }
48
48
 
49
49
  .s-checkbox {
50
+ // Less variables for check svg fill color
51
+ @ch-bg-image-fill: .set-white()[default];
52
+ @ch-bg-image-fill-dark: .set-white-dark()[default];
50
53
 
51
54
  // CONTEXTUAL STYLES
55
+ .dark-mode({
56
+ &:checked {
57
+ --_ch-bg-image: url("data:image/svg+xml,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.41L8.59 2 4 6.59 2.41 5 1 6.41l3 3z' fill='@{ch-bg-image-fill-dark}'/%3E%3C/svg%3E");
58
+ }
59
+ &:indeterminate {
60
+ --_ch-bg-image: url("data:image/svg+xml,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='@{ch-bg-image-fill-dark}'/%3E%3C/svg%3E");
61
+ }
62
+ });
63
+
52
64
  .highcontrast-dark-mode({
53
65
  &:checked, &:indeterminate {
54
66
  --_ch-bc: var(--blue-500) !important;
@@ -68,11 +80,11 @@
68
80
  }
69
81
 
70
82
  &:checked {
71
- --_ch-bg-image: url("data:image/svg+xml,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.41L8.59 2 4 6.59 2.41 5 1 6.41l3 3z' fill='%23fff'/%3E%3C/svg%3E");
83
+ --_ch-bg-image: url("data:image/svg+xml,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3.41L8.59 2 4 6.59 2.41 5 1 6.41l3 3z' fill='@{ch-bg-image-fill}'/%3E%3C/svg%3E");
72
84
  }
73
85
 
74
86
  &:indeterminate {
75
- --_ch-bg-image: url("data:image/svg+xml,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='%23fff'/%3E%3C/svg%3E");
87
+ --_ch-bg-image: url("data:image/svg+xml,%3Csvg width='11' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5 h7 v2 h-7 z' fill='@{ch-bg-image-fill}'/%3E%3C/svg%3E");
76
88
  }
77
89
 
78
90
  // INTERACTION
@@ -98,12 +110,6 @@
98
110
  }
99
111
  });
100
112
 
101
- .dark-mode({
102
- &:checked {
103
- --_ch-bg: var(--black);
104
- }
105
- });
106
-
107
113
  // STATES
108
114
  &:checked {
109
115
  --_ch-baw: 0.30769231em;
@@ -15,7 +15,7 @@ describe("code block", () => {
15
15
  ...defaultOptions,
16
16
  includeNullModifier: false,
17
17
  },
18
- // TODO new colors should resolve this issue
18
+ // TODO revisit these skipped test ids
19
19
  skippedTestids: [
20
20
  "s-code-block-language-html-light",
21
21
  "s-code-block-language-html-highcontrast-light",
@@ -0,0 +1,112 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ // TODO note: all accessibility tests here are skipped currently. Revisit in Stacks v2
6
+
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ const template = ({ component, testid, classes = "", icon }: any) => html`
9
+ <div data-testid="${testid}" class="p8 ws4 ${classes}">
10
+ <label for="default-id">Label</label>
11
+ ${component}${icon}
12
+ </div>
13
+ `;
14
+
15
+ const customAttributes = [
16
+ {
17
+ placeholder: "Enter your text here",
18
+ },
19
+ {
20
+ readonly: "",
21
+ },
22
+ {
23
+ disabled: "",
24
+ },
25
+ ];
26
+
27
+ const states = ["has-error", "has-warning", "has-success"];
28
+ const sizes = ["sm", "md", "lg", "xl"];
29
+ const otherModifiers = ["creditcard", "search"];
30
+
31
+ ["input", "textarea"].map((type) => {
32
+ const children =
33
+ type === "textarea" ? { default: "Enter your text here" } : undefined;
34
+
35
+ describe(type, () => {
36
+ // Base styles w/ value, modifiers
37
+ runComponentTests({
38
+ type: "a11y",
39
+ baseClass: `s-${type}`,
40
+ modifiers: {
41
+ primary: [...sizes, ...otherModifiers],
42
+ },
43
+ tag: type,
44
+ attributes:
45
+ type === "input"
46
+ ? {
47
+ type: "text",
48
+ value: "Text input value",
49
+ id: `default-id`,
50
+ }
51
+ : {
52
+ id: `default-id`,
53
+ },
54
+ children,
55
+ template,
56
+ });
57
+
58
+ // Base styles w/o value; w/ readonly attr; w/ disabled attr
59
+ customAttributes.forEach((attributes) => {
60
+ const attrString = Object.keys(attributes).sort().join("-");
61
+
62
+ runComponentTests({
63
+ type: "a11y",
64
+ baseClass: `s-${type} ${attrString}`,
65
+ tag: type,
66
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
67
+ // @ts-ignore
68
+ attributes:
69
+ type === "input"
70
+ ? {
71
+ type: "text",
72
+ value: attributes.placeholder
73
+ ? null
74
+ : "Text input value",
75
+ id: `default-id`,
76
+ ...attributes,
77
+ }
78
+ : {
79
+ id: `default-id`,
80
+ ...attributes,
81
+ },
82
+ children,
83
+ template,
84
+ // TODO revisit these skipped test ids
85
+ skippedTestids: [/readonly/],
86
+ });
87
+ });
88
+
89
+ // w/ state classes
90
+ states.forEach((state) => {
91
+ runComponentTests({
92
+ type: "a11y",
93
+ baseClass: `s-${type} state-${state}`,
94
+ tag: type,
95
+ attributes:
96
+ type === "input"
97
+ ? {
98
+ type: "text",
99
+ value: "Text input value",
100
+ id: `default-id`,
101
+ }
102
+ : {
103
+ id: "default-id",
104
+ },
105
+ children,
106
+ template: ({ component, testid }) =>
107
+ template({ component, testid, classes: state }),
108
+ });
109
+ });
110
+ // TODO interaction (focus) states?
111
+ });
112
+ });
@@ -0,0 +1,98 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const template = ({ component, testid, classes = "", icon }: any) => html`
7
+ <div data-testid="${testid}" class="p8 ws4 ${classes}">
8
+ ${component}${icon}
9
+ </div>
10
+ `;
11
+
12
+ const customAttributes = [
13
+ {
14
+ placeholder: "Enter your text here",
15
+ },
16
+ {
17
+ readonly: "",
18
+ },
19
+ {
20
+ disabled: "",
21
+ },
22
+ ] as Record<string, string>[];
23
+
24
+ const states = ["has-error", "has-warning", "has-success", "is-readonly"];
25
+ const sizes = ["sm", "md", "lg", "xl"];
26
+ const otherModifiers = ["creditcard", "search"];
27
+
28
+ ["input", "textarea"].map((type) => {
29
+ const children =
30
+ type === "textarea" ? { default: "Enter your text here" } : undefined;
31
+
32
+ describe(type, () => {
33
+ // Base styles w/ value, modifiers
34
+ runComponentTests({
35
+ type: "visual",
36
+ baseClass: `s-${type}`,
37
+ modifiers: {
38
+ primary: [...sizes, ...otherModifiers],
39
+ },
40
+ tag: type,
41
+ attributes:
42
+ type === "input"
43
+ ? {
44
+ type: "text",
45
+ value: "Text input value",
46
+ }
47
+ : {},
48
+ children,
49
+ template,
50
+ });
51
+
52
+ // Base styles w/o value; w/ readonly attr; w/ disabled attr
53
+ customAttributes.forEach((attributes) => {
54
+ const attrString = Object.keys(attributes).sort().join("-");
55
+ let attr = attributes;
56
+ if (type === "input") {
57
+ attr = {
58
+ type: "text",
59
+ ...attributes,
60
+ };
61
+ if (!attributes.placeholder) {
62
+ attr = {
63
+ value: "Text input value",
64
+ ...attr,
65
+ };
66
+ }
67
+ }
68
+ runComponentTests({
69
+ type: "visual",
70
+ baseClass: `s-${type} ${attrString}`,
71
+ tag: type,
72
+ attributes: attr,
73
+ children,
74
+ template,
75
+ });
76
+ });
77
+
78
+ // w/ state classes; .is-readonly
79
+ states.forEach((state) => {
80
+ runComponentTests({
81
+ type: "visual",
82
+ baseClass: `s-${type} state-${state}`,
83
+ tag: type,
84
+ attributes:
85
+ type === "input"
86
+ ? {
87
+ type: "text",
88
+ value: "Text input value",
89
+ }
90
+ : {},
91
+ children,
92
+ template: ({ component, testid }) =>
93
+ template({ component, testid, classes: state }),
94
+ });
95
+ });
96
+ // TODO interaction (focus) states?
97
+ });
98
+ });
@@ -91,7 +91,7 @@
91
91
 
92
92
  color: var(--fc-medium);
93
93
  font-family: inherit;
94
- font-weight: 600;
94
+ font-weight: 700;
95
95
  padding: 0 var(--su2); // Helps the label visually line up with inputs
96
96
  }
97
97
 
@@ -109,7 +109,7 @@
109
109
  &:hover{
110
110
  &,
111
111
  &.s-link__visited {
112
- color: var(--theme-link-color-hover, var(--theme-secondary-400));
112
+ color: var(--theme-link-color-hover, var(--theme-secondary-500));
113
113
  }
114
114
  }
115
115
 
@@ -126,7 +126,7 @@
126
126
  }
127
127
 
128
128
  &.s-link__visited:visited {
129
- color: var(--theme-link-color, var(--theme-secondary-400));
129
+ color: var(--theme-link-color, var(--theme-secondary-600));
130
130
  }
131
131
 
132
132
  color: var(--theme-link-color, var(--theme-secondary-400));
@@ -94,6 +94,7 @@
94
94
  font-weight: normal;
95
95
  line-height: var(--lh-sm);
96
96
  margin-bottom: var(--su16);
97
+ margin-right: var(--su24);
97
98
  }
98
99
 
99
100
  background-color: var(--_mo-bg);
@@ -74,7 +74,5 @@ describe("navigation", () => {
74
74
  ${component}
75
75
  </nav>
76
76
  `,
77
- // TODO new colors should resolve the `.is-selected` failures
78
- skippedTestids: [/s-navigation/],
79
77
  });
80
78
  });
@@ -0,0 +1,29 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ describe("page title", () => {
6
+ runComponentTests({
7
+ type: "a11y",
8
+ baseClass: "s-page-title",
9
+ children: {
10
+ default: `
11
+ <div class="s-page-title--text">
12
+ <nav class="s-breadcrumbs" aria-label="example-breadcrumbs">…</nav>
13
+ <h1 class="s-page-title--header">Page title</h1>
14
+ <p class="s-page-title--description">
15
+ Optional description de Finibus Bonorum et Malorum
16
+ </p>
17
+ </div>
18
+ <div class="s-page-title--actions">
19
+ <button class="s-btn s-btn__filled" type="button">Action</button>
20
+ </div>
21
+ `,
22
+ },
23
+ template: ({ component, testid }) => html`
24
+ <div class="d-block p8 ws6" data-testid="${testid}">
25
+ ${component}
26
+ </div>
27
+ `,
28
+ });
29
+ });
@@ -0,0 +1,59 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const postTitleTemplate = ({ component, testid }: any) => html`
7
+ <div class="d-block p8 ws6" data-testid="${testid}">${component}</div>
8
+ `;
9
+
10
+ const getChildren = ({
11
+ showEverything = false,
12
+ }: {
13
+ showEverything: boolean;
14
+ }) => `
15
+ <div class="s-page-title--text">
16
+ ${
17
+ showEverything
18
+ ? `
19
+ <nav class="s-breadcrumbs" aria-label="example-breadcrumbs">
20
+ <div class="s-breadcrumbs--item">
21
+ <a class="s-breadcrumbs--link">Stack Overflow</a>
22
+ </div>
23
+ </nav>
24
+ `
25
+ : ""
26
+ }
27
+ <h1 class="s-page-title--header">Page title</h1>
28
+ ${
29
+ showEverything
30
+ ? `
31
+ <p class="s-page-title--description">
32
+ Optional description de Finibus Bonorum et Malorum
33
+ </p>
34
+ `
35
+ : ""
36
+ }
37
+ </div>
38
+ ${
39
+ showEverything
40
+ ? `
41
+ <div class="s-page-title--actions">
42
+ <button class="s-btn s-btn__filled" type="button">Action</button>
43
+ </div>
44
+ `
45
+ : ""
46
+ }
47
+ `;
48
+
49
+ describe("page title", () => {
50
+ runComponentTests({
51
+ type: "visual",
52
+ baseClass: "s-page-title",
53
+ children: {
54
+ default: getChildren({ showEverything: false }),
55
+ complete: getChildren({ showEverything: true }),
56
+ },
57
+ template: postTitleTemplate,
58
+ });
59
+ });
@@ -6,8 +6,8 @@
6
6
  // Child components
7
7
  --_ps-content-excerpt-fc: var(--_ps-state-fc, var(--fc-medium));
8
8
  --_ps-content-title-a-fc: var(--_ps-state-fc, var(--theme-post-title-color, var(--theme-link-color, var(--theme-secondary-400))));
9
- --_ps-content-title-a-fc-hover: var(--_ps-state-fc, var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--theme-secondary-400))));
10
- --_ps-content-title-a-fc-visited: var(--_ps-state-fc, var(--theme-post-title-color-visited, var(--theme-link-color-visited, var(--theme-secondary-500))));
9
+ --_ps-content-title-a-fc-hover: var(--_ps-state-fc, var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--theme-secondary-500))));
10
+ --_ps-content-title-a-fc-visited: var(--_ps-state-fc, var(--theme-post-title-color-visited, var(--theme-link-color-visited, var(--theme-secondary-600))));
11
11
  --_ps-stats-ai: flex-end;
12
12
  --_ps-stats-fc: var(--_ps-state-fc, var(--fc-light));
13
13
  --_ps-stats-fd: column;
@@ -115,11 +115,11 @@
115
115
 
116
116
  &&__watched {
117
117
  &:not(.s-post-summary__deleted):not(.s-post-summary__ignored) {
118
- --_ps-bg: var(--yellow-200);
118
+ --_ps-bg: var(--yellow-100);
119
119
  --_ps-stats-fc: var(--black-400);
120
120
  --_ps-content-title-a-fc: var(--theme-post-title-color, var(--theme-link-color, var(--theme-secondary-400)));
121
- --_ps-content-title-a-fc-hover: var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--theme-secondary-400)));
122
- --_ps-content-title-a-fc-visited: var(--theme-post-title-color-visited, var(--theme-link-color-visited, var(--theme-secondary-500)));
121
+ --_ps-content-title-a-fc-hover: var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--theme-secondary-500)));
122
+ --_ps-content-title-a-fc-visited: var(--theme-post-title-color-visited, var(--theme-link-color-visited, var(--theme-secondary-600)));
123
123
 
124
124
  .s-user-card {
125
125
  a {
@@ -0,0 +1,29 @@
1
+ import { IconClearSm } from "@stackoverflow/stacks-icons";
2
+ import { runComponentTests } from "../../test/test-utils";
3
+ import "../../index";
4
+
5
+ const children = {
6
+ default: `default`,
7
+ dismiss: `dismiss <span class="s-tag--dismiss">${IconClearSm}</span>`,
8
+ sponsor: `<img class="s-tag--sponsor" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII" width="16" height="16" alt="sponsor">sponsor`,
9
+ };
10
+
11
+ describe("tag", () => {
12
+ runComponentTests({
13
+ type: "a11y",
14
+ baseClass: "s-tag",
15
+ variants: ["ignored", "watched", "moderator", "muted", "required"],
16
+ modifiers: {
17
+ global: ["is-selected"],
18
+ },
19
+ children,
20
+ // TODO: revisit this after minor tag changes are made
21
+ skippedTestids: [
22
+ /s-tag-highcontrast-light-muted/, // 6.33
23
+ /s-tag-light-is-selected/, // 58.28Lc
24
+ /s-tag-light-ignored-is-selected/, // 58.28Lc
25
+ /s-tag-light-moderator-is-selected/, // 49.14Lc
26
+ /s-tag-light-watched-is-selected/, // 58.28Lc
27
+ ],
28
+ });
29
+ });
@@ -18,6 +18,7 @@
18
18
  // CONTEXTUAL STYLES
19
19
  .highcontrast-mode({
20
20
  --_ta-bc: currentColor;
21
+ --_ta-bg-selected: var(--theme-secondary-400);
21
22
 
22
23
  text-decoration: none;
23
24
  });
@@ -30,7 +31,8 @@
30
31
  a&:hover,
31
32
  a&:focus {
32
33
  .highcontrast-mode({
33
- border-color: currentColor;
34
+ --_ta-bc-selected: transparent;
35
+ --_ta-fc-selected: var(--white);
34
36
  });
35
37
 
36
38
  background-color: var(--_ta-bg-selected);
@@ -99,6 +101,10 @@
99
101
 
100
102
  // moderator overrides other muted and required, required overrides muted
101
103
  &&__moderator {
104
+ .highcontrast-mode({
105
+ --_ta-bg-selected: var(--orange-500);
106
+ });
107
+
102
108
  --_ta-bc: transparent;
103
109
  --_ta-bg: var(--orange-100);
104
110
  --_ta-fc: var(--orange-500);
@@ -0,0 +1,46 @@
1
+ import { html } from "@open-wc/testing";
2
+ import { IconClearSm } from "@stackoverflow/stacks-icons";
3
+ import { defaultOptions, runComponentTests } from "../../test/test-utils";
4
+ import "../../index";
5
+
6
+ const children = {
7
+ default: `default`,
8
+ dismiss: `dismiss <span class="s-tag--dismiss">${IconClearSm}</span>`,
9
+ sponsor: `<img class="s-tag--sponsor" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII" width="16" height="16" alt="sponsor">sponsor`,
10
+ };
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
+ const template = ({ component, testid }: any) => html`
14
+ <div data-testid="${testid}" class="d-inline-block p4">${component}</div>
15
+ `;
16
+
17
+ describe("tag", () => {
18
+ runComponentTests({
19
+ type: "visual",
20
+ baseClass: "s-tag",
21
+ variants: ["ignored", "watched", "moderator", "muted", "required"],
22
+ modifiers: {
23
+ global: ["is-selected"],
24
+ },
25
+ children,
26
+ template,
27
+ });
28
+
29
+ // Size modifiers
30
+ runComponentTests({
31
+ type: "visual",
32
+ baseClass: "s-tag",
33
+ modifiers: {
34
+ primary: ["xs", "sm", "md", "lg"],
35
+ global: ["is-selected"],
36
+ },
37
+ children: {
38
+ default: `default`,
39
+ },
40
+ template,
41
+ options: {
42
+ ...defaultOptions,
43
+ includeNullModifier: false,
44
+ },
45
+ });
46
+ });
@@ -1,10 +1,17 @@
1
1
  .s-toggle-switch {
2
+ @ts-bg-image-fill: .set-white()[default];
3
+ @ts-bg-image-fill-dark: .set-white-dark()[default];
2
4
  --_ts-bg: var(--black-350);
5
+ --_ts-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='@{ts-bg-image-fill}'/%3e%3c/svg%3e");
3
6
  --_ts-bg-ps: left center;
4
7
  --_ts-bs-color: transparent;
5
8
  --_ts-multiple-bg: unset;
6
9
  --_ts-multiple-fc: var(--black-400);
7
10
 
11
+ .dark-mode({
12
+ --_ts-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='@{ts-bg-image-fill-dark}'/%3e%3c/svg%3e");
13
+ });
14
+
8
15
  fieldset[disabled] &,
9
16
  &[disabled] {
10
17
  &,
@@ -93,7 +100,7 @@
93
100
  box-shadow: 0 0 0 var(--su-static4) var(--_ts-bs-color);
94
101
 
95
102
  appearance: none;
96
- background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); // The white dot within the toggle
103
+ background-image: var(--_ts-bg-image);
97
104
  background-size: contain;
98
105
  background-repeat: no-repeat;
99
106
  border-radius: 1000px;