@stackoverflow/stacks 1.7.0 → 1.8.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 +1 -1
- package/dist/css/stacks.css +677 -508
- package/dist/css/stacks.min.css +1 -1
- package/lib/css/base/fieldset.less +5 -0
- package/lib/css/components/buttons.less +4 -4
- package/lib/css/components/checkboxes-radios.less +158 -0
- package/lib/css/components/description.less +9 -0
- package/lib/css/components/inputs.less +198 -567
- package/lib/css/components/labels.less +4 -4
- package/lib/css/components/link.less +23 -8
- package/lib/css/components/post-summary.less +10 -2
- package/lib/css/components/select.less +148 -0
- package/lib/css/components/tags.less +3 -3
- package/lib/css/components/toggle-switches.less +8 -0
- package/lib/css/exports/mixins.less +73 -11
- package/lib/css/input-utils.less +44 -0
- package/lib/css/stacks-static.less +16 -26
- package/lib/test/s-avatar.a11y.test.ts +77 -0
- package/lib/test/s-btn.a11y.test.ts +123 -0
- package/lib/test/{s-button.visual.test.ts → s-btn.visual.test.ts} +5 -1
- package/package.json +17 -16
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// STATES
|
|
60
|
+
fieldset[disabled] &,
|
|
60
61
|
&[disabled],
|
|
61
62
|
&[aria-disabled="true"] {
|
|
62
63
|
--_bu-bs: none !important;
|
|
@@ -221,18 +222,17 @@
|
|
|
221
222
|
|
|
222
223
|
// Size
|
|
223
224
|
&&__xs {
|
|
225
|
+
.size-styles(xs; bu; @styles: fs);
|
|
224
226
|
--_bu-dropdown-bw: calc(var(--su-static4) - var(--su-static1));
|
|
225
|
-
--_bu-fs: var(--fs-fine);
|
|
226
227
|
--_bu-p: 0.6em;
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
&&__sm {
|
|
230
|
-
|
|
231
|
+
.size-styles(sm; bu; @styles: fs);
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
&&__md {
|
|
234
|
-
|
|
235
|
-
--_bu-fs: var(--fs-body3);
|
|
235
|
+
.size-styles(md; bu; @styles: br, fs);
|
|
236
236
|
--_bu-p: 0.7em;
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
.s-checkbox,
|
|
2
|
+
.s-radio {
|
|
3
|
+
--_ch-baw: var(--su-static1);
|
|
4
|
+
--_ch-bc: var(--bc-darker);
|
|
5
|
+
--_ch-bc-focus: var(--theme-secondary-300);
|
|
6
|
+
--_ch-bg: var(--white);
|
|
7
|
+
--_ch-bg-image: unset;
|
|
8
|
+
--_ch-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
9
|
+
|
|
10
|
+
// CONTEXTUAL STYLES
|
|
11
|
+
fieldset[disabled] &,
|
|
12
|
+
&[disabled] {
|
|
13
|
+
cursor: not-allowed;
|
|
14
|
+
opacity: var(--_o-disabled-static);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.s-check-control & {
|
|
18
|
+
&[disabled] + .s-label {
|
|
19
|
+
&:extend(.is-disabled .s-label);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.s-check-group & {
|
|
24
|
+
margin-top: calc(var(--su2) + var(--su1)); // 3px
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
input& {
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// INTERACTION
|
|
32
|
+
&:focus {
|
|
33
|
+
box-shadow: var(--_ch-bs-focus);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
background-color: var(--_ch-bg);
|
|
37
|
+
border: var(--_ch-baw) solid var(--_ch-bc);
|
|
38
|
+
|
|
39
|
+
appearance: none;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
font-size: inherit;
|
|
42
|
+
height: 1em;
|
|
43
|
+
margin: 0; // A guard against Core's default margins
|
|
44
|
+
outline: 0;
|
|
45
|
+
vertical-align: middle;
|
|
46
|
+
width: 1em;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.s-checkbox {
|
|
50
|
+
|
|
51
|
+
// CONTEXTUAL STYLES
|
|
52
|
+
.highcontrast-dark-mode({
|
|
53
|
+
&:checked, &:indeterminate {
|
|
54
|
+
--_ch-bc: var(--blue-700) !important;
|
|
55
|
+
--_ch-bc-focus: var(--_ch-bc);
|
|
56
|
+
--_ch-bg: var(--blue-300);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// STATES
|
|
61
|
+
&:checked, &:indeterminate {
|
|
62
|
+
--_ch-bc: var(--theme-secondary-400) !important;
|
|
63
|
+
--_ch-bg: var(--theme-secondary-400);
|
|
64
|
+
|
|
65
|
+
&:focus {
|
|
66
|
+
--_ch-bc-focus: var(--theme-secondary-400);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&: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");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&: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");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// INTERACTION
|
|
79
|
+
&:focus {
|
|
80
|
+
border-color: var(--_ch-bc-focus);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
background-image: var(--_ch-bg-image);
|
|
84
|
+
|
|
85
|
+
background-position: center center;
|
|
86
|
+
background-repeat: no-repeat;
|
|
87
|
+
background-size: contain;
|
|
88
|
+
border-radius: var(--br-sm);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.s-radio {
|
|
92
|
+
|
|
93
|
+
// CONTEXTUAL STYLES
|
|
94
|
+
.highcontrast-dark-mode({
|
|
95
|
+
&:checked {
|
|
96
|
+
--_ch-bc: var(--blue-300);
|
|
97
|
+
outline: var(--su-static1) solid var(--black);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
.dark-mode({
|
|
102
|
+
&:checked {
|
|
103
|
+
--_ch-bg: var(--black);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// STATES
|
|
108
|
+
&:checked {
|
|
109
|
+
--_ch-baw: 0.30769231em;
|
|
110
|
+
--_ch-bc: var(--theme-secondary-400);
|
|
111
|
+
--_ch-bg: var(--white);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
border-radius: var(--br-circle);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.s-checkbox,
|
|
118
|
+
.s-radio:not(:checked) {
|
|
119
|
+
.validation-states(ch);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.s-check-control { // TODO would _love_ to use .s-check instead, with no class on the input itself
|
|
123
|
+
--_cc-ai: center;
|
|
124
|
+
|
|
125
|
+
// CONTEXTUAL STYLES
|
|
126
|
+
.s-check-group & {
|
|
127
|
+
--_cc-ai: flex-start; // manually align the checkboxes and radios to the top of the group
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// CHILD ELEMENTS
|
|
131
|
+
.s-label {
|
|
132
|
+
font-weight: normal;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
align-items: var(--_cc-ai);
|
|
136
|
+
display: flex;
|
|
137
|
+
gap: var(--su8);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.s-check-group {
|
|
141
|
+
--_cg-fd: column;
|
|
142
|
+
|
|
143
|
+
// MODIFIERS
|
|
144
|
+
&&__horizontal {
|
|
145
|
+
--_cg-fd: row;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// CHILD ELEMENTS
|
|
149
|
+
// TODO HACK? <legend> isn't respecting gap...
|
|
150
|
+
legend.s-label {
|
|
151
|
+
margin-bottom: var(--su8);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
flex-direction: var(--_cg-fd);
|
|
155
|
+
|
|
156
|
+
display: flex;
|
|
157
|
+
gap: var(--su8);
|
|
158
|
+
}
|