@stackoverflow/stacks 2.0.0-rc.9 → 2.0.1
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/dist/css/stacks.css +268 -233
- package/dist/css/stacks.min.css +1 -1
- package/lib/atomic/typography.less +2 -2
- package/lib/components/activity-indicator/activity-indicator.less +1 -1
- package/lib/components/badge/badge.less +10 -10
- package/lib/components/checkbox_radio/checkbox_radio.less +14 -8
- package/lib/components/code-block/code-block.a11y.test.ts +1 -1
- package/lib/components/input-fill/input-fill.a11y.test.ts +22 -0
- package/lib/components/input-fill/input-fill.visual.test.ts +22 -0
- package/lib/components/input-message/input-message.a11y.test.ts +58 -0
- package/lib/components/input-message/input-message.visual.test.ts +59 -0
- package/lib/components/input_textarea/input_textarea.a11y.test.ts +112 -0
- package/lib/components/input_textarea/input_textarea.visual.test.ts +98 -0
- package/lib/components/label/label.less +1 -1
- package/lib/components/link-preview/link-preview.less +2 -2
- package/lib/components/modal/modal.less +1 -0
- package/lib/components/navigation/navigation.a11y.test.ts +0 -2
- package/lib/components/page-title/page-title.a11y.test.ts +29 -0
- package/lib/components/page-title/page-title.visual.test.ts +59 -0
- package/lib/components/post-summary/post-summary.less +5 -5
- package/lib/components/tag/tag.a11y.test.ts +29 -0
- package/lib/components/tag/tag.less +31 -17
- package/lib/components/tag/tag.visual.test.ts +46 -0
- package/lib/components/toggle-switch/toggle-switch.less +8 -1
- package/lib/components/topbar/topbar.less +30 -14
- package/lib/components/uploader/uploader.less +1 -1
- package/lib/components/user-card/user-card.less +2 -2
- package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +62 -62
- package/lib/exports/__snapshots__/color.less.test.ts.snap +137 -137
- package/lib/exports/color-mixins.less +15 -12
- package/lib/exports/color-sets.less +56 -56
- package/lib/exports/mixins.less +3 -14
- package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +28 -28
- package/lib/test/test-utils.ts +1 -3
- package/package.json +9 -9
|
@@ -56,7 +56,7 @@ p {
|
|
|
56
56
|
}, @force-selector: true);
|
|
57
57
|
|
|
58
58
|
.fs-category {
|
|
59
|
-
font-weight:
|
|
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:
|
|
92
|
+
.fw-bold { font-weight: 700 !important; }
|
|
93
93
|
|
|
94
94
|
// -- Font Styles
|
|
95
95
|
.fs-normal { font-style: normal !important; }
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
// CONTEXTUAL STYLES
|
|
14
14
|
.highcontrast-mode({
|
|
15
15
|
// Badge counts
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
&__gold,
|
|
17
|
+
&__silver,
|
|
18
|
+
&__bronze,
|
|
19
19
|
// Number counts
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
&__rep,
|
|
21
|
+
&__rep-down,
|
|
22
|
+
&__votes:not(.s-badge__answered),
|
|
23
23
|
// Users
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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-
|
|
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='
|
|
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='
|
|
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
|
|
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,22 @@
|
|
|
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 }: any) => html`
|
|
7
|
+
<div data-testid="${testid}" class="p8 ws1">${component}</div>
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
describe("input-fill", () => {
|
|
11
|
+
runComponentTests({
|
|
12
|
+
type: "a11y",
|
|
13
|
+
baseClass: `s-input-fill`,
|
|
14
|
+
modifiers: {
|
|
15
|
+
global: ["order-first", "order-last"],
|
|
16
|
+
},
|
|
17
|
+
children: {
|
|
18
|
+
default: "input fill",
|
|
19
|
+
},
|
|
20
|
+
template,
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
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 }: any) => html`
|
|
7
|
+
<div data-testid="${testid}" class="p8 ws1">${component}</div>
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
describe("input-fill", () => {
|
|
11
|
+
runComponentTests({
|
|
12
|
+
type: "visual",
|
|
13
|
+
baseClass: `s-input-fill`,
|
|
14
|
+
modifiers: {
|
|
15
|
+
global: ["order-first", "order-last"],
|
|
16
|
+
},
|
|
17
|
+
children: {
|
|
18
|
+
default: "input fill",
|
|
19
|
+
},
|
|
20
|
+
template,
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { html } from "@open-wc/testing";
|
|
2
|
+
import { runComponentTests } from "../../test/test-utils";
|
|
3
|
+
import "../../index";
|
|
4
|
+
|
|
5
|
+
const states = [
|
|
6
|
+
{
|
|
7
|
+
class: "",
|
|
8
|
+
children:
|
|
9
|
+
'This is a stateless input message. <a href="">Learn more</a>.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
class: "has-error",
|
|
13
|
+
children: 'This is an error input message. <a href="">Learn more</a>.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
class: "has-success",
|
|
17
|
+
children: 'This is a success input message. <a href="">Learn more</a>.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
class: "has-warning",
|
|
21
|
+
children: 'This is a warning input message. <a href="">Learn more</a>.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
class: "disabled",
|
|
25
|
+
children: "This is a disabled input message.",
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
describe("input-message", () => {
|
|
30
|
+
states.forEach((state) => {
|
|
31
|
+
runComponentTests({
|
|
32
|
+
type: "a11y",
|
|
33
|
+
baseClass: `s-input-message ${
|
|
34
|
+
state.class ? `state-${state.class}` : ""
|
|
35
|
+
}`,
|
|
36
|
+
children: {
|
|
37
|
+
default: state.children,
|
|
38
|
+
},
|
|
39
|
+
template: ({ component, testid }) => {
|
|
40
|
+
const isDisabled = state.class === "disabled";
|
|
41
|
+
const stateClass =
|
|
42
|
+
state.class && state.class !== "disabled"
|
|
43
|
+
? state.class
|
|
44
|
+
: "";
|
|
45
|
+
|
|
46
|
+
return html`
|
|
47
|
+
<fieldset
|
|
48
|
+
data-testid="${testid}"
|
|
49
|
+
class="${stateClass}"
|
|
50
|
+
?disabled="${isDisabled}"
|
|
51
|
+
>
|
|
52
|
+
${component}
|
|
53
|
+
</fieldset>
|
|
54
|
+
`;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { html } from "@open-wc/testing";
|
|
2
|
+
import { runComponentTests } from "../../test/test-utils";
|
|
3
|
+
import "../../index";
|
|
4
|
+
|
|
5
|
+
const states = [
|
|
6
|
+
{
|
|
7
|
+
class: "",
|
|
8
|
+
children:
|
|
9
|
+
'This is a stateless input message. <a href="">Learn more</a>.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
class: "has-error",
|
|
13
|
+
children: 'This is an error input message. <a href="">Learn more</a>.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
class: "has-success",
|
|
17
|
+
children: 'This is a success input message. <a href="">Learn more</a>.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
class: "has-warning",
|
|
21
|
+
children: 'This is a warning input message. <a href="">Learn more</a>.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
class: "disabled",
|
|
25
|
+
children:
|
|
26
|
+
'This is a disabled input message. <a href="">Learn more</a>.',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
describe("input-message", () => {
|
|
31
|
+
states.forEach((state) => {
|
|
32
|
+
runComponentTests({
|
|
33
|
+
type: "visual",
|
|
34
|
+
baseClass: `s-input-message ${
|
|
35
|
+
state.class ? `state-${state.class}` : ""
|
|
36
|
+
}`,
|
|
37
|
+
children: {
|
|
38
|
+
default: state.children,
|
|
39
|
+
},
|
|
40
|
+
template: ({ component, testid }) => {
|
|
41
|
+
const isDisabled = state.class === "disabled";
|
|
42
|
+
const stateClass =
|
|
43
|
+
state.class && state.class !== "disabled"
|
|
44
|
+
? state.class
|
|
45
|
+
: "";
|
|
46
|
+
|
|
47
|
+
return html`
|
|
48
|
+
<fieldset
|
|
49
|
+
data-testid="${testid}"
|
|
50
|
+
class="p8 ws3 ${stateClass}"
|
|
51
|
+
?disabled="${isDisabled}"
|
|
52
|
+
>
|
|
53
|
+
${component}
|
|
54
|
+
</fieldset>
|
|
55
|
+
`;
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -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
|
+
});
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
&:hover{
|
|
110
110
|
&,
|
|
111
111
|
&.s-link__visited {
|
|
112
|
-
color: var(--theme-link-color-hover, var(--theme-secondary-
|
|
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-
|
|
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));
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
122
|
-
--_ps-content-title-a-fc-visited: var(--theme-post-title-color-visited, var(--theme-link-color-visited, var(--theme-secondary-
|
|
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 {
|