@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
|
@@ -1,666 +1,297 @@
|
|
|
1
|
-
@input-padding: 0.6em 0.7em;
|
|
2
|
-
|
|
3
|
-
@autofill: {
|
|
4
|
-
&::-webkit-contacts-auto-fill-button {
|
|
5
|
-
background-color: var(--black); // In Safari, make the autocomplete button darkmode-aware
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
&:-webkit-autofill {
|
|
9
|
-
border-color: var(--blue-300);
|
|
10
|
-
-webkit-text-fill-color: var(--black);
|
|
11
|
-
-webkit-box-shadow: 0 0 0 1000px var(--theme-secondary-050) inset; // This acts as a background color by stretching an inset box shadow across the input
|
|
12
|
-
transition: background-color 0s 50000s; // A hack to infinitely delay background styles that come from the browser.
|
|
13
|
-
|
|
14
|
-
&:focus {
|
|
15
|
-
border-color: var(--blue-300);
|
|
16
|
-
// Since the box shadow is overwritten to show a background, we have to re-add the focus outline
|
|
17
|
-
-webkit-box-shadow: 0 0 0 1000px var(--blue-050) inset, 0 0 0 var(--su-static4) var(--focus-ring);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// ============================================================================
|
|
23
|
-
// $ BASE INPUT / TEXTAREA STYLE
|
|
24
|
-
// ----------------------------------------------------------------------------
|
|
25
1
|
.s-input,
|
|
26
2
|
.s-textarea {
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
3
|
+
--_in-bc: var(--bc-darker);
|
|
4
|
+
--_in-bc-focus: var(--theme-secondary-300);
|
|
5
|
+
--_in-bg: var(--white);
|
|
6
|
+
--_in-br: var(--br-sm);
|
|
7
|
+
--_in-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
8
|
+
--_in-c: unset;
|
|
9
|
+
--_in-fc: var(--fc-dark);
|
|
10
|
+
--_in-fc-focus: var(--black);
|
|
11
|
+
--_in-fs: var(--fs-body1);
|
|
12
|
+
--_in-o: unset;
|
|
13
|
+
--_in-px: 0.7em;
|
|
14
|
+
--_in-py: 0.6em;
|
|
15
|
+
--_in-placeholder-fc: var(--black-200);
|
|
16
|
+
|
|
17
|
+
// CONTEXTUAL STYLES
|
|
41
18
|
@supports (-webkit-overflow-scrolling: touch) {
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
--_in-fs: var(--su-static16); // 16px — Increase font size for mobile safari. This keeps our inputs from zooming the page while focused.
|
|
20
|
+
--_in-px: 0.55em;
|
|
21
|
+
--_in-py: 0.36em;
|
|
44
22
|
|
|
45
23
|
&::-webkit-input-placeholder {
|
|
46
24
|
line-height: normal !important;
|
|
47
25
|
}
|
|
48
26
|
}
|
|
49
27
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
28
|
+
.highcontrast-mode({
|
|
29
|
+
--_in-bc: var(--black);
|
|
30
|
+
--_in-placeholder-fc: var(--black-400);
|
|
31
|
+
});
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
// MODIFIERS
|
|
34
|
+
fieldset[disabled] &,
|
|
35
|
+
&[disabled],
|
|
36
|
+
&[readonly],
|
|
37
|
+
.is-readonly & {
|
|
38
|
+
--_in-c: not-allowed;
|
|
58
39
|
}
|
|
59
40
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
41
|
+
fieldset[disabled] &,
|
|
42
|
+
&[disabled] {
|
|
43
|
+
--_in-o: var(--_o-disabled-static);
|
|
44
|
+
}
|
|
63
45
|
|
|
46
|
+
&[readonly],
|
|
47
|
+
.is-readonly & {
|
|
64
48
|
.highcontrast-mode({
|
|
65
|
-
|
|
49
|
+
--_in-fc: var(--fc-light);
|
|
66
50
|
});
|
|
67
|
-
}
|
|
68
51
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.s-input.s-input__search,
|
|
77
|
-
.s-input.s-input__creditcard {
|
|
78
|
-
padding-left: var(--su-static32);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// ============================================================================
|
|
83
|
-
// $ FIELDSET
|
|
84
|
-
// ----------------------------------------------------------------------------
|
|
85
|
-
fieldset {
|
|
86
|
-
min-width: 0;
|
|
87
|
-
padding: 0;
|
|
88
|
-
border: 0;
|
|
89
|
-
|
|
90
|
-
&[disabled] {
|
|
91
|
-
a,
|
|
92
|
-
.s-btn,
|
|
93
|
-
.s-link {
|
|
94
|
-
box-shadow: none !important;
|
|
95
|
-
opacity: var(--_o-disabled-static);
|
|
96
|
-
pointer-events: none;
|
|
97
|
-
}
|
|
52
|
+
--_in-bg: var(--black-050);
|
|
53
|
+
--_in-bc: var(--bc-light);
|
|
54
|
+
--_in-fc: var(--black-200);
|
|
55
|
+
--_in-fc-focus: var(--_in-fc);
|
|
56
|
+
}
|
|
98
57
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.
|
|
102
|
-
.
|
|
103
|
-
.
|
|
104
|
-
|
|
105
|
-
opacity: var(--_o-disabled-static);
|
|
106
|
-
}
|
|
58
|
+
.validation-states(
|
|
59
|
+
in,
|
|
60
|
+
{ .highcontrast-mode({ --_in-bc: var(--red-400); }); },
|
|
61
|
+
{ .highcontrast-mode({ --_in-bc: var(--green-400); }); },
|
|
62
|
+
{ .highcontrast-mode({ --_in-bc: var(--yellow-600); }); }
|
|
63
|
+
);
|
|
107
64
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.
|
|
111
|
-
cursor: not-allowed;
|
|
112
|
-
opacity: var(--_o-disabled-static);
|
|
113
|
-
}
|
|
65
|
+
// Sizes
|
|
66
|
+
&&__sm {
|
|
67
|
+
.size-styles(sm; in; @styles: fs);
|
|
114
68
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// ============================================================================
|
|
118
|
-
// $ TEXT STYLES
|
|
119
|
-
// ============================================================================
|
|
120
|
-
.s-description {
|
|
121
|
-
padding: 0 var(--su2); // Helps the label visually line up with inputs
|
|
122
|
-
color: var(--fc-medium);
|
|
123
|
-
font-size: var(--fs-caption);
|
|
124
|
-
}
|
|
125
69
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
padding: @input-padding;
|
|
132
|
-
border: 1px solid var(--bc-darker);
|
|
133
|
-
border-right-width: 0;
|
|
134
|
-
border-left-width: 0;
|
|
135
|
-
background-color: var(--black-050);
|
|
136
|
-
color: var(--fc-medium);
|
|
137
|
-
font-family: inherit;
|
|
138
|
-
white-space: nowrap;
|
|
139
|
-
line-height: var(--lh-sm);
|
|
70
|
+
&&__md {
|
|
71
|
+
@supports (-webkit-overflow-scrolling: touch) {
|
|
72
|
+
--_in-fs: 17px;
|
|
73
|
+
--_in-py: 0.4em;
|
|
74
|
+
}
|
|
140
75
|
|
|
141
|
-
|
|
142
|
-
border-color: transparent;
|
|
143
|
-
background-color: transparent;
|
|
76
|
+
.size-styles(md; in; @styles: br, fs);
|
|
144
77
|
}
|
|
145
78
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
79
|
+
&&__lg {
|
|
80
|
+
.size-styles(lg; in; @styles: br, fs);
|
|
81
|
+
--_in-px: 0.6em;
|
|
82
|
+
--_in-py: 0.45em;
|
|
150
83
|
}
|
|
151
84
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
85
|
+
&&__xl {
|
|
86
|
+
.size-styles(xl; in; @styles: br, fs);
|
|
87
|
+
--_in-px: 0.5em;
|
|
88
|
+
--_in-py: 0.4em;
|
|
156
89
|
}
|
|
157
|
-
}
|
|
158
90
|
|
|
91
|
+
// CHILD ELEMENTS
|
|
92
|
+
.webkit-autofill();
|
|
159
93
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.s-select {
|
|
164
|
-
position: relative;
|
|
165
|
-
color: var(--fc-dark);
|
|
166
|
-
|
|
167
|
-
// -- MENU ARROWS
|
|
168
|
-
// To customize the visual appearance of the select menu arrows, we
|
|
169
|
-
// need to recreate them on the wrapping .select div.
|
|
170
|
-
// ------------------------------------------------------------------------
|
|
171
|
-
&:before,
|
|
172
|
-
&:after {
|
|
173
|
-
content: "";
|
|
174
|
-
position: absolute;
|
|
175
|
-
z-index: var(--zi-selected);
|
|
176
|
-
right: 13px;
|
|
177
|
-
border-color: currentColor transparent;
|
|
178
|
-
border-style: solid;
|
|
179
|
-
border-width: 4px;
|
|
180
|
-
pointer-events: none;
|
|
94
|
+
&::placeholder,
|
|
95
|
+
&::-webkit-input-placeholder {
|
|
96
|
+
color: var(--_in-placeholder-fc);
|
|
181
97
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
border-bottom-width: 4px;
|
|
98
|
+
|
|
99
|
+
&::placeholder {
|
|
100
|
+
opacity: 1;
|
|
186
101
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
102
|
+
|
|
103
|
+
&&__creditcard,
|
|
104
|
+
&&__search {
|
|
105
|
+
--_in-pl: var(--su-static32);
|
|
191
106
|
}
|
|
192
107
|
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-webkit-appearance: none;
|
|
199
|
-
-moz-appearance: none;
|
|
200
|
-
appearance: none;
|
|
201
|
-
|
|
202
|
-
// [2] Update the styles
|
|
203
|
-
position: relative; // This prevents Firefox from requiring a second click to select options
|
|
204
|
-
width: 100%;
|
|
205
|
-
height: 100%; // Fill the height of its parent
|
|
206
|
-
padding: @input-padding;
|
|
207
|
-
padding-right: var(--su32);
|
|
208
|
-
border: 1px solid var(--bc-darker);
|
|
209
|
-
border-radius: var(--br-sm);
|
|
210
|
-
background-color: var(--white);
|
|
108
|
+
// INTERACTION
|
|
109
|
+
&:focus{
|
|
110
|
+
border-color: var(--_in-bc-focus);
|
|
111
|
+
box-shadow: var(--_in-bs-focus);
|
|
112
|
+
color: var(--_in-fc-focus);
|
|
211
113
|
outline: 0;
|
|
212
|
-
|
|
213
|
-
font-family: inherit;
|
|
214
|
-
color: var(--black);
|
|
215
|
-
line-height: var(--lh-sm);
|
|
216
|
-
|
|
217
|
-
&::-moz-focus-inner {
|
|
218
|
-
outline: none !important;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
&:-moz-focusring {
|
|
222
|
-
color: transparent;
|
|
223
|
-
text-shadow: 0 0 0 #000;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
&::-ms-expand {
|
|
227
|
-
display: none;
|
|
228
|
-
}
|
|
114
|
+
}
|
|
229
115
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
116
|
+
@scrollbar-styles();
|
|
117
|
+
background-color: var(--_in-bg);
|
|
118
|
+
border: var(--su-static1) solid var(--_in-bc);
|
|
119
|
+
border-radius: var(--_in-br);
|
|
120
|
+
color: var(--_in-fc);
|
|
121
|
+
cursor: var(--_in-c);
|
|
122
|
+
font-size: var(--_in-fs);
|
|
123
|
+
opacity: var(--_in-o);
|
|
124
|
+
padding: var(--_in-py) var(--_in-px) var(--_in-py) var(--_in-pl, var(--_in-px));
|
|
237
125
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
126
|
+
-webkit-appearance: none; // Removes shadows we don't want in mobile Safari
|
|
127
|
+
font-family: inherit;
|
|
128
|
+
margin: 0; // A guard against Core's default margins
|
|
129
|
+
width: 100%;
|
|
241
130
|
}
|
|
242
131
|
|
|
132
|
+
.s-input {
|
|
133
|
+
.input-states({
|
|
134
|
+
padding-right: var(--su32);
|
|
135
|
+
});
|
|
243
136
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
.s-check-control {
|
|
249
|
-
display: flex;
|
|
250
|
-
gap: var(--su8);
|
|
251
|
-
align-items: center;
|
|
137
|
+
&:focus-within {
|
|
138
|
+
.highcontrast-mode({
|
|
139
|
+
--_in-bc-focus: var(--black);
|
|
140
|
+
});
|
|
252
141
|
|
|
253
|
-
|
|
254
|
-
|
|
142
|
+
border-color: var(--_in-bc-focus);
|
|
143
|
+
box-shadow: var(--_in-bs-focus);
|
|
144
|
+
color: var(--_in-fc-focus);
|
|
145
|
+
outline: 0;
|
|
255
146
|
}
|
|
256
147
|
|
|
257
|
-
|
|
258
|
-
|
|
148
|
+
&&__md {
|
|
149
|
+
--_in-py: 0.5em;
|
|
259
150
|
}
|
|
260
151
|
}
|
|
261
152
|
|
|
262
|
-
.s-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
&&__horizontal {
|
|
268
|
-
flex-direction: row;
|
|
269
|
-
}
|
|
153
|
+
.s-textarea {
|
|
154
|
+
.input-states({
|
|
155
|
+
padding-right: var(--su48);
|
|
156
|
+
});
|
|
270
157
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
margin-bottom: var(--su8);
|
|
158
|
+
&&__md {
|
|
159
|
+
--_in-py: 0.72em;
|
|
274
160
|
}
|
|
275
161
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
.s-checkbox, .s-radio {
|
|
281
|
-
margin-top: calc(var(--su2) + var(--su1)); // 3px
|
|
162
|
+
~ .s-input-icon {
|
|
163
|
+
right: 1.5em;
|
|
164
|
+
top: 1.5em;
|
|
282
165
|
}
|
|
283
166
|
}
|
|
284
167
|
|
|
285
|
-
|
|
286
|
-
.s-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
display: none;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// [2] Now re-style the checkboxes and radios
|
|
297
|
-
// ------------------------------------------------------------------------
|
|
298
|
-
margin: 0; // A guard against Core's default margins
|
|
299
|
-
width: 1em;
|
|
300
|
-
height: 1em;
|
|
301
|
-
border: 1px solid var(--bc-darker);
|
|
302
|
-
background-color: var(--white);
|
|
303
|
-
outline: 0;
|
|
304
|
-
font-size: inherit;
|
|
305
|
-
vertical-align: middle;
|
|
306
|
-
cursor: pointer;
|
|
307
|
-
}
|
|
168
|
+
// Other input-related elements
|
|
169
|
+
.s-input-fill {
|
|
170
|
+
--_if-bc: var(--bc-darker);
|
|
171
|
+
--_if-bg: var(--black-050);
|
|
172
|
+
--_if-blw: 0;
|
|
173
|
+
--_if-blr: 0;
|
|
174
|
+
--_if-brr: 0;
|
|
175
|
+
--_if-brw: 0;
|
|
308
176
|
|
|
309
|
-
|
|
310
|
-
|
|
177
|
+
&&__clear {
|
|
178
|
+
--_if-bc: transparent;
|
|
179
|
+
--_if-bg: transparent;
|
|
311
180
|
}
|
|
312
181
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
cursor: not-allowed;
|
|
182
|
+
&.order-first {
|
|
183
|
+
--_if-blw: var(--su-static1);
|
|
184
|
+
--_if-blr: var(--br-sm);
|
|
317
185
|
}
|
|
318
|
-
}
|
|
319
186
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
@supports ((-webkit-appearance: none) or (-moz-appearance: none) or (appearance: none)) {
|
|
324
|
-
border-radius: var(--br-sm);
|
|
325
|
-
background-position: center center;
|
|
326
|
-
background-repeat: no-repeat;
|
|
327
|
-
background-size: contain;
|
|
328
|
-
|
|
329
|
-
&:checked, &:indeterminate {
|
|
330
|
-
border-color: var(--theme-secondary-400) !important;
|
|
331
|
-
background-color: var(--theme-secondary-400);
|
|
332
|
-
|
|
333
|
-
.highcontrast-dark-mode({
|
|
334
|
-
border-color: var(--blue-700) !important;
|
|
335
|
-
background-color: var(--blue-300);
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
&:focus {
|
|
339
|
-
border-color: var(--theme-secondary-400);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
&:checked {
|
|
344
|
-
background-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");
|
|
345
|
-
}
|
|
346
|
-
&:indeterminate {
|
|
347
|
-
background-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");
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
&:focus {
|
|
351
|
-
border-color: var(--theme-secondary-300);
|
|
352
|
-
box-shadow: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
353
|
-
}
|
|
187
|
+
&.order-last {
|
|
188
|
+
--_if-brw: var(--su-static1);
|
|
189
|
+
--_if-brr: var(--br-sm);
|
|
354
190
|
}
|
|
355
|
-
}
|
|
356
191
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
&:checked {
|
|
364
|
-
border-color: var(--theme-secondary-400);
|
|
365
|
-
border-width: 0.30769231em;
|
|
366
|
-
background-color: @white; // This should always be white regardless of dark mode
|
|
367
|
-
|
|
368
|
-
.highcontrast-dark-mode({
|
|
369
|
-
border-color: var(--blue-300);
|
|
370
|
-
outline: 1px solid var(--black);
|
|
371
|
-
});
|
|
372
|
-
}
|
|
192
|
+
background-color: var(--_if-bg);
|
|
193
|
+
border: var(--su-static1) solid var(--_if-bc);
|
|
194
|
+
border-left-width: var(--_if-blw);
|
|
195
|
+
border-right-width: var(--_if-brw);
|
|
196
|
+
border-radius: var(--_if-blr) var(--_if-brr) var(--_if-brr) var(--_if-blr);
|
|
373
197
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
198
|
+
color: var(--fc-medium);
|
|
199
|
+
font-family: inherit;
|
|
200
|
+
line-height: var(--lh-sm);
|
|
201
|
+
padding: 0.6em 0.7em;
|
|
202
|
+
white-space: nowrap;
|
|
378
203
|
}
|
|
379
204
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
// ----------------------------------------------------------------------------
|
|
384
|
-
// Focus
|
|
385
|
-
& {
|
|
386
|
-
@focus-style: {
|
|
387
|
-
border-color: var(--theme-secondary-300);
|
|
388
|
-
box-shadow: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
389
|
-
color: var(--black);
|
|
390
|
-
outline: 0;
|
|
205
|
+
.s-input-icon {
|
|
206
|
+
--_ii-fc: unset;
|
|
207
|
+
--_ii-r: 0.7em;
|
|
391
208
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
209
|
+
// MODIFIERS
|
|
210
|
+
.has-error & {
|
|
211
|
+
--_ii-fc: var(--red-400);
|
|
395
212
|
}
|
|
396
213
|
|
|
397
|
-
.
|
|
398
|
-
|
|
399
|
-
.s-textarea:focus,
|
|
400
|
-
.s-select > select:focus {
|
|
401
|
-
@focus-style();
|
|
214
|
+
.has-success & {
|
|
215
|
+
--_ii-fc: var(--green-400);
|
|
402
216
|
}
|
|
403
217
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
.s-input:focus-within {
|
|
407
|
-
@focus-style();
|
|
218
|
+
.has-warning & {
|
|
219
|
+
--_ii-fc: var(--yellow-600);
|
|
408
220
|
}
|
|
409
|
-
}
|
|
410
221
|
|
|
411
|
-
.
|
|
412
|
-
|
|
413
|
-
.s-select > select {
|
|
414
|
-
// Disabled
|
|
415
|
-
&[disabled] {
|
|
416
|
-
cursor: not-allowed;
|
|
417
|
-
opacity: var(--_o-disabled-static);
|
|
222
|
+
.is-disabled & {
|
|
223
|
+
--_ii-fc: var(--black-400);
|
|
418
224
|
}
|
|
419
225
|
|
|
420
|
-
// Readonly
|
|
421
|
-
// Note: The readonly attribute is not supported on select elements
|
|
422
|
-
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly
|
|
423
|
-
// and https://github.com/StackExchange/Stacks/pull/1040#discussion_r931144086
|
|
424
|
-
&[readonly],
|
|
425
226
|
.is-readonly & {
|
|
426
|
-
|
|
427
|
-
background-color: var(--black-050);
|
|
428
|
-
color: var(--black-200);
|
|
429
|
-
cursor: not-allowed;
|
|
227
|
+
--_ii-fc: var(--black-200);
|
|
430
228
|
|
|
431
229
|
.highcontrast-mode({
|
|
432
|
-
|
|
230
|
+
--_ii-fc: var(--fc-light);
|
|
433
231
|
});
|
|
434
232
|
}
|
|
435
|
-
}
|
|
436
233
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
// ----------------------------------------------------------------------------
|
|
441
|
-
.is-disabled,
|
|
442
|
-
.is-readonly,
|
|
443
|
-
.has-success,
|
|
444
|
-
.has-error,
|
|
445
|
-
.has-warning {
|
|
446
|
-
position: relative;
|
|
447
|
-
|
|
448
|
-
.s-input {
|
|
449
|
-
padding-right: var(--su32);
|
|
450
|
-
}
|
|
234
|
+
&&__creditcard,
|
|
235
|
+
&&__search {
|
|
236
|
+
--_ii-r: auto;
|
|
451
237
|
|
|
452
|
-
|
|
453
|
-
|
|
238
|
+
color: var(--black-400);
|
|
239
|
+
left: 0.7em;
|
|
454
240
|
}
|
|
455
241
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
~ .s-input-icon {
|
|
460
|
-
top: 1.5em;
|
|
461
|
-
right: 1.5em;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
242
|
+
color: var(--_ii-fc);
|
|
243
|
+
right: var(--_ii-r);
|
|
464
244
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
245
|
+
margin-top: -9px; // Half the icon's height at 18px for centering;
|
|
246
|
+
pointer-events: none;
|
|
247
|
+
position: absolute;
|
|
248
|
+
top: 50%;
|
|
468
249
|
}
|
|
250
|
+
.s-input-message {
|
|
251
|
+
--_im-fc: unset;
|
|
252
|
+
--_im-a-fc: unset;
|
|
253
|
+
--_im-a-fc-hover: unset;
|
|
469
254
|
|
|
470
|
-
|
|
471
|
-
// ----------------------------------------------------------------------------
|
|
472
|
-
.has-warning {
|
|
473
|
-
.s-input,
|
|
474
|
-
.s-textarea,
|
|
475
|
-
.s-checkbox,
|
|
476
|
-
.s-radio:not(:checked),
|
|
477
|
-
.s-select > select {
|
|
478
|
-
border-color: var(--yellow-600);
|
|
479
|
-
|
|
480
|
-
&:focus {
|
|
481
|
-
box-shadow: 0 0 0 var(--su-static4) var(--focus-ring-warning);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
.s-input-message {
|
|
486
|
-
color: var(--yellow-800);
|
|
487
|
-
|
|
255
|
+
.input-states({
|
|
488
256
|
a {
|
|
489
|
-
|
|
257
|
+
text-decoration: underline;
|
|
490
258
|
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.s-input-icon {
|
|
494
|
-
color: var(--yellow-600);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
259
|
+
});
|
|
497
260
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
.s-input,
|
|
502
|
-
.s-textarea,
|
|
503
|
-
.s-checkbox,
|
|
504
|
-
.s-radio:not(:checked),
|
|
505
|
-
.s-select > select {
|
|
506
|
-
border-color: var(--red-400);
|
|
507
|
-
|
|
508
|
-
&:focus {
|
|
509
|
-
box-shadow: 0 0 0 var(--su-static4) var(--focus-ring-error);
|
|
510
|
-
}
|
|
261
|
+
fieldset[disabled] & {
|
|
262
|
+
cursor: not-allowed;
|
|
263
|
+
opacity: var(--_o-disabled-static);
|
|
511
264
|
}
|
|
512
265
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
a
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
&:hover {
|
|
520
|
-
color: var(--red-900);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
266
|
+
// MODIFIERS
|
|
267
|
+
.has-error & {
|
|
268
|
+
--_im-fc: var(--red-500);
|
|
269
|
+
--_im-a-fc: var(--red-800);
|
|
270
|
+
--_im-a-fc-hover: var(--red-900);
|
|
523
271
|
}
|
|
524
272
|
|
|
525
|
-
.
|
|
526
|
-
|
|
273
|
+
.has-success & {
|
|
274
|
+
--_im-fc: var(--green-500);
|
|
275
|
+
--_im-a-fc: var(--green-800);
|
|
276
|
+
--_im-a-fc-hover: var(--green-900);
|
|
527
277
|
}
|
|
528
|
-
}
|
|
529
278
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
.s-input,
|
|
534
|
-
.s-textarea,
|
|
535
|
-
.s-checkbox,
|
|
536
|
-
.s-radio:not(:checked),
|
|
537
|
-
.s-select > select {
|
|
538
|
-
border-color: var(--green-400);
|
|
539
|
-
|
|
540
|
-
&:focus {
|
|
541
|
-
box-shadow: 0 0 0 var(--su-static4) var(--focus-ring-success);
|
|
542
|
-
}
|
|
279
|
+
.has-warning & {
|
|
280
|
+
--_im-fc: var(--yellow-800);
|
|
281
|
+
--_im-a-fc: var(--yellow-900);
|
|
543
282
|
}
|
|
544
283
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
color: var(--green-800);
|
|
550
|
-
|
|
551
|
-
&:hover {
|
|
552
|
-
color: var(--green-900);
|
|
553
|
-
}
|
|
284
|
+
// CHILD ELEMENTS
|
|
285
|
+
a {
|
|
286
|
+
&:hover {
|
|
287
|
+
color: var(--_im-a-fc-hover);
|
|
554
288
|
}
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
.s-input-icon {
|
|
558
|
-
color: var(--green-400);
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
// $$ DISABLED
|
|
563
|
-
// ----------------------------------------------------------------------------
|
|
564
|
-
.is-disabled {
|
|
565
|
-
.s-select:before,
|
|
566
|
-
.s-select:after {
|
|
567
|
-
border-color: var(--bc-darker) transparent;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
.s-description {
|
|
571
|
-
opacity: var(--_o-disabled-static);
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
.s-input-icon {
|
|
575
|
-
color: var(--black-400);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// $$ READONLY
|
|
580
|
-
// ----------------------------------------------------------------------------
|
|
581
|
-
.is-readonly {
|
|
582
|
-
.s-input-icon {
|
|
583
|
-
color: var(--black-200);
|
|
584
|
-
|
|
585
|
-
.highcontrast-mode({
|
|
586
|
-
color: var(--fc-light);
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
// $$ ICONS
|
|
592
|
-
// ----------------------------------------------------------------------------
|
|
593
|
-
.s-input-icon {
|
|
594
|
-
position: absolute;
|
|
595
|
-
top: 50%;
|
|
596
|
-
right: 0.7em;
|
|
597
|
-
margin-top: -9px; // Half the icon's height at 18px for centering;
|
|
598
|
-
pointer-events: none;
|
|
599
289
|
|
|
600
|
-
|
|
601
|
-
&.s-input-icon__creditcard {
|
|
602
|
-
right: auto;
|
|
603
|
-
left: 0.7em;
|
|
604
|
-
color: var(--black-400);
|
|
290
|
+
color: var(--_im-a-fc);
|
|
605
291
|
}
|
|
606
|
-
}
|
|
607
292
|
|
|
608
|
-
|
|
609
|
-
// Set some baseline styles
|
|
610
|
-
// ----------------------------------------------------------------------------
|
|
611
|
-
.s-input-message {
|
|
612
|
-
padding: var(--su2);
|
|
613
|
-
font-size: var(--fs-caption);
|
|
614
|
-
}
|
|
293
|
+
color: var(--_im-fc);
|
|
615
294
|
|
|
616
|
-
// $$ PADDING ADJUSTMENTS AND SIZES
|
|
617
|
-
// ----------------------------------------------------------------------------
|
|
618
|
-
.s-input__sm,
|
|
619
|
-
.s-textarea__sm,
|
|
620
|
-
.s-select__sm > select {
|
|
621
295
|
font-size: var(--fs-caption);
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
.s-input__md,
|
|
625
|
-
.s-textarea__md,
|
|
626
|
-
.s-select__md > select {
|
|
627
|
-
font-size: var(--fs-body3);
|
|
628
|
-
padding-top: 0.5em;
|
|
629
|
-
padding-bottom: 0.5em;
|
|
630
|
-
border-radius: calc(var(--br-sm) + 1px);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
.s-textarea__md {
|
|
634
|
-
padding-top: 0.72em;
|
|
635
|
-
padding-bottom: 0.72em;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
.s-input__lg,
|
|
639
|
-
.s-textarea__lg,
|
|
640
|
-
.s-select__lg > select {
|
|
641
|
-
font-size: var(--fs-title);
|
|
642
|
-
padding: 0.45em 0.6em;
|
|
643
|
-
border-radius: calc(var(--br-sm) + 1px);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
.s-input__xl,
|
|
647
|
-
.s-textarea__xl,
|
|
648
|
-
.s-select__xl > select {
|
|
649
|
-
font-size: var(--fs-headline1);
|
|
650
|
-
padding: 0.4em 0.5em;
|
|
651
|
-
border-radius: var(--br-md);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
.s-input__md,
|
|
655
|
-
.s-textarea__md {
|
|
656
|
-
// -- INCREASE FONT SIZE FOR MOBILE SAFARI
|
|
657
|
-
// This keeps our inputs from zooming the page while focused
|
|
658
|
-
// ------------------------------------------------------------------------
|
|
659
|
-
@supports (-webkit-overflow-scrolling: touch) {
|
|
660
|
-
font-size: 17px;
|
|
661
|
-
|
|
662
|
-
// Compensate for the larger font size so we generally keep the input the same size
|
|
663
|
-
padding-top: 0.4em;
|
|
664
|
-
padding-bottom: 0.4em;
|
|
665
|
-
}
|
|
296
|
+
padding: var(--su2);
|
|
666
297
|
}
|