@stackoverflow/stacks 1.7.1 → 1.9.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/components/activity-indicator/activity-indicator.a11y.test.d.ts +1 -0
- package/dist/components/activity-indicator/activity-indicator.visual.test.d.ts +1 -0
- package/dist/components/avatar/avatar.a11y.test.d.ts +1 -0
- package/dist/components/avatar/avatar.visual.test.d.ts +1 -0
- package/dist/{controllers/s-banner.d.ts → components/banner/banner.d.ts} +1 -1
- package/dist/components/banner/banner.test.d.ts +1 -0
- package/dist/components/banner/banner.visual.test.d.ts +1 -0
- package/dist/components/button/button.a11y.test.d.ts +1 -0
- package/dist/components/button/button.visual.test.d.ts +1 -0
- package/dist/{controllers/s-expandable-control.d.ts → components/expandable/expandable.d.ts} +1 -1
- package/dist/components/expandable/expandable.test.d.ts +1 -0
- package/dist/{controllers/s-modal.d.ts → components/modal/modal.d.ts} +1 -1
- package/dist/{controllers/s-navigation-tablist.d.ts → components/navigation/navigation.d.ts} +1 -1
- package/dist/{controllers/s-popover.d.ts → components/popover/popover.d.ts} +1 -1
- package/dist/{controllers/s-tooltip.d.ts → components/popover/tooltip.d.ts} +1 -1
- package/dist/components/popover/tooltip.test.d.ts +1 -0
- package/dist/components/popover/tooltip.visual.test.d.ts +1 -0
- package/dist/{controllers/s-table.d.ts → components/table/table.d.ts} +1 -1
- package/dist/{controllers/s-toast.d.ts → components/toast/toast.d.ts} +1 -1
- package/dist/components/toast/toast.test.d.ts +1 -0
- package/dist/components/toast/toast.visual.test.d.ts +1 -0
- package/dist/{controllers/s-uploader.d.ts → components/uploader/uploader.d.ts} +1 -1
- package/dist/controllers.d.ts +9 -0
- package/dist/css/stacks.css +1351 -1171
- package/dist/css/stacks.min.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/js/stacks.js +545 -545
- package/dist/js/stacks.min.js +1 -1
- package/dist/test/test-utils.d.ts +136 -0
- package/lib/{css/atomic/borders.less → atomic/border.less} +18 -0
- package/lib/base/fieldset.less +5 -0
- package/lib/{css/base/icons.less → base/icon.less} +0 -9
- package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +21 -0
- package/lib/components/activity-indicator/activity-indicator.visual.test.ts +23 -0
- package/lib/components/avatar/avatar.a11y.test.ts +36 -0
- package/lib/components/avatar/avatar.visual.test.ts +54 -0
- package/lib/components/banner/banner.less +51 -0
- package/lib/{test/s-banner.test.ts → components/banner/banner.test.ts} +7 -3
- package/lib/{ts/controllers/s-banner.ts → components/banner/banner.ts} +1 -1
- package/lib/components/banner/banner.visual.test.ts +36 -0
- package/lib/components/button/button.a11y.test.ts +32 -0
- package/lib/{css/components/buttons.less → components/button/button.less} +7 -6
- package/lib/components/button/button.visual.test.ts +52 -0
- package/lib/{css/components/cards.less → components/card/card.less} +1 -1
- package/lib/components/check-control/check-control.less +17 -0
- package/lib/components/check-group/check-group.less +19 -0
- package/lib/components/checkbox_radio/checkbox_radio.less +158 -0
- package/lib/components/description/description.less +9 -0
- package/lib/{css/components → components/expandable}/expandable.less +3 -0
- package/lib/components/expandable/expandable.test.ts +53 -0
- package/lib/{ts/controllers/s-expandable-control.ts → components/expandable/expandable.ts} +1 -1
- package/lib/components/input-fill/input-fill.less +35 -0
- package/lib/components/input-icon/input-icon.less +45 -0
- package/lib/components/input-message/input-message.less +48 -0
- package/lib/components/input_textarea/input_textarea.less +166 -0
- package/lib/{css/components/labels.less → components/label/label.less} +4 -4
- package/lib/{css/components → components/link}/link.less +9 -2
- package/lib/{ts/controllers/s-modal.ts → components/modal/modal.ts} +1 -1
- package/lib/{ts/controllers/s-navigation-tablist.ts → components/navigation/navigation.ts} +1 -1
- package/lib/{css/components/notices.less → components/notice/notice.less} +0 -89
- package/lib/{css/components/popovers.less → components/popover/popover.less} +1 -0
- package/lib/{ts/controllers/s-popover.ts → components/popover/popover.ts} +1 -1
- package/lib/{test/s-tooltip.test.ts → components/popover/tooltip.test.ts} +6 -2
- package/lib/{ts/controllers/s-tooltip.ts → components/popover/tooltip.ts} +2 -2
- package/lib/{test/s-tooltip.visual.test.ts → components/popover/tooltip.visual.test.ts} +2 -2
- package/lib/{css/components → components/post-summary}/post-summary.less +6 -2
- package/lib/components/select/select.less +148 -0
- package/lib/{css/components/sidebar-widgets.less → components/sidebar-widget/sidebar-widget.less} +0 -1
- package/lib/{css/components → components/table}/table.less +0 -5
- package/lib/{ts/controllers/s-table.ts → components/table/table.ts} +1 -1
- package/lib/components/table-container/table-container.less +4 -0
- package/lib/{css/components/tags.less → components/tag/tag.less} +3 -3
- package/lib/components/toast/toast.less +35 -0
- package/lib/{test/s-toast.test.ts → components/toast/toast.test.ts} +7 -3
- package/lib/{ts/controllers/s-toast.ts → components/toast/toast.ts} +1 -1
- package/lib/components/toast/toast.visual.test.ts +27 -0
- package/lib/{css/components/toggle-switches.less → components/toggle-switch/toggle-switch.less} +8 -0
- package/lib/{ts/controllers/s-uploader.ts → components/uploader/uploader.ts} +1 -1
- package/lib/controllers.ts +33 -0
- package/lib/{css/exports → exports}/mixins.less +73 -11
- package/lib/{ts/index.ts → index.ts} +1 -1
- package/lib/input-utils.less +44 -0
- package/lib/{css/stacks-dynamic.less → stacks-dynamic.less} +1 -2
- package/lib/stacks-static.less +93 -0
- package/lib/test/test-utils.ts +444 -0
- package/lib/tsconfig.json +1 -1
- package/package.json +26 -25
- package/dist/controllers/index.d.ts +0 -9
- package/lib/css/components/inputs.less +0 -666
- package/lib/css/stacks-static.less +0 -97
- package/lib/test/s-avatar.test.ts +0 -74
- package/lib/test/s-banner.visual.test.ts +0 -61
- package/lib/test/s-button.visual.test.ts +0 -12
- package/lib/test/s-toast.visual.test.ts +0 -48
- package/lib/ts/controllers/index.ts +0 -17
- /package/lib/{css/atomic/colors.less → atomic/color.less} +0 -0
- /package/lib/{css/atomic → atomic}/flex.less +0 -0
- /package/lib/{css/atomic → atomic}/gap.less +0 -0
- /package/lib/{css/atomic → atomic}/grid.less +0 -0
- /package/lib/{css/atomic → atomic}/misc.less +0 -0
- /package/lib/{css/atomic → atomic}/spacing.less +0 -0
- /package/lib/{css/atomic → atomic}/typography.less +0 -0
- /package/lib/{css/atomic → atomic}/width-height.less +0 -0
- /package/lib/{css/base → base}/body.less +0 -0
- /package/lib/{css/base → base}/configuration-static.less +0 -0
- /package/lib/{css/base/internals.less → base/internal.less} +0 -0
- /package/lib/{css/base → base}/reset-meyer.less +0 -0
- /package/lib/{css/base → base}/reset-normalize.less +0 -0
- /package/lib/{css/base → base}/reset.less +0 -0
- /package/lib/{css/components → components/activity-indicator}/activity-indicator.less +0 -0
- /package/lib/{css/components/anchors.less → components/anchor/anchor.less} +0 -0
- /package/lib/{css/components/avatars.less → components/avatar/avatar.less} +0 -0
- /package/lib/{css/components → components/award-bling}/award-bling.less +0 -0
- /package/lib/{css/components/badges.less → components/badge/badge.less} +0 -0
- /package/lib/{css/components → components/block-link}/block-link.less +0 -0
- /package/lib/{css/components → components/breadcrumbs}/breadcrumbs.less +0 -0
- /package/lib/{css/components/button-groups.less → components/button-group/button-group.less} +0 -0
- /package/lib/{css/components/code-blocks.less → components/code-block/code-block.less} +0 -0
- /package/lib/{css/components/empty-states.less → components/empty-state/empty-state.less} +0 -0
- /package/lib/{css/components/link-previews.less → components/link-preview/link-preview.less} +0 -0
- /package/lib/{css/components → components/menu}/menu.less +0 -0
- /package/lib/{css/components/modals.less → components/modal/modal.less} +0 -0
- /package/lib/{css/components → components/navigation}/navigation.less +0 -0
- /package/lib/{css/components/page-titles.less → components/page-title/page-title.less} +0 -0
- /package/lib/{css/components → components/pagination}/pagination.less +0 -0
- /package/lib/{css/components/progress-bars.less → components/progress-bar/progress-bar.less} +0 -0
- /package/lib/{css/components → components/prose}/prose.less +0 -0
- /package/lib/{css/components → components/spinner}/spinner.less +0 -0
- /package/lib/{css/components → components/topbar}/topbar.less +0 -0
- /package/lib/{css/components → components/uploader}/uploader.less +0 -0
- /package/lib/{css/components/user-cards.less → components/user-card/user-card.less} +0 -0
- /package/lib/{css/exports → exports}/constants-colors.less +0 -0
- /package/lib/{css/exports → exports}/constants-helpers.less +0 -0
- /package/lib/{css/exports → exports}/constants-type.less +0 -0
- /package/lib/{css/exports → exports}/exports.less +0 -0
- /package/lib/{css/stacks.less → stacks.less} +0 -0
- /package/lib/{ts/stacks.ts → stacks.ts} +0 -0
|
@@ -1,666 +0,0 @@
|
|
|
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
|
-
.s-input,
|
|
26
|
-
.s-textarea {
|
|
27
|
-
-webkit-appearance: none; // Removes shadows we don't want in mobile Safari
|
|
28
|
-
width: 100%;
|
|
29
|
-
margin: 0; // A guard against Core's default margins
|
|
30
|
-
padding: @input-padding;
|
|
31
|
-
border: 1px solid var(--bc-darker);
|
|
32
|
-
border-radius: var(--br-sm);
|
|
33
|
-
background-color: var(--white);
|
|
34
|
-
color: var(--fc-dark);
|
|
35
|
-
font-size: var(--fs-body1);
|
|
36
|
-
font-family: inherit;
|
|
37
|
-
|
|
38
|
-
// -- INCREASE FONT SIZE FOR MOBILE SAFARI
|
|
39
|
-
// This keeps our inputs from zooming the page while focused
|
|
40
|
-
// ------------------------------------------------------------------------
|
|
41
|
-
@supports (-webkit-overflow-scrolling: touch) {
|
|
42
|
-
font-size: 16px;
|
|
43
|
-
padding: 0.36em 0.55em; // Compensate for the larger font size so we generally keep the input the same size
|
|
44
|
-
|
|
45
|
-
&::-webkit-input-placeholder {
|
|
46
|
-
line-height: normal !important;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// -- PLACEHOLDER
|
|
51
|
-
// ------------------------------------------------------------------------
|
|
52
|
-
&::-webkit-input-placeholder {
|
|
53
|
-
color: var(--black-200);
|
|
54
|
-
|
|
55
|
-
.highcontrast-mode({
|
|
56
|
-
color: var(--black-400);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&::placeholder {
|
|
61
|
-
color: var(--black-200);
|
|
62
|
-
opacity: 1;
|
|
63
|
-
|
|
64
|
-
.highcontrast-mode({
|
|
65
|
-
color: var(--black-400);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// -- STYLE SCROLLBARS
|
|
70
|
-
@scrollbar-styles();
|
|
71
|
-
|
|
72
|
-
// -- STYLE AUTOFILL STATES
|
|
73
|
-
@autofill();
|
|
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
|
-
}
|
|
98
|
-
|
|
99
|
-
.s-checkbox,
|
|
100
|
-
.s-input-message,
|
|
101
|
-
.s-radio,
|
|
102
|
-
.s-toggle-switch,
|
|
103
|
-
.s-toggle-switch label {
|
|
104
|
-
cursor: not-allowed;
|
|
105
|
-
opacity: var(--_o-disabled-static);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.s-input,
|
|
109
|
-
.s-textarea,
|
|
110
|
-
.s-select > select {
|
|
111
|
-
cursor: not-allowed;
|
|
112
|
-
opacity: var(--_o-disabled-static);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
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
|
-
|
|
126
|
-
// ============================================================================
|
|
127
|
-
// $ CONNECTED INPUTS
|
|
128
|
-
// To visually connect inputs together
|
|
129
|
-
// ----------------------------------------------------------------------------
|
|
130
|
-
.s-input-fill {
|
|
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);
|
|
140
|
-
|
|
141
|
-
&.s-input-fill__clear {
|
|
142
|
-
border-color: transparent;
|
|
143
|
-
background-color: transparent;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&.order-first {
|
|
147
|
-
border-left-width: 1px;
|
|
148
|
-
border-top-left-radius: var(--br-sm);
|
|
149
|
-
border-bottom-left-radius: var(--br-sm);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&.order-last {
|
|
153
|
-
border-right-width: 1px;
|
|
154
|
-
border-top-right-radius: var(--br-sm);
|
|
155
|
-
border-bottom-right-radius: var(--br-sm);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
// ============================================================================
|
|
161
|
-
// $ SELECT MENUS
|
|
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;
|
|
181
|
-
}
|
|
182
|
-
&:before {
|
|
183
|
-
top: calc(50% - 5px);
|
|
184
|
-
border-top-width: 0;
|
|
185
|
-
border-bottom-width: 4px;
|
|
186
|
-
}
|
|
187
|
-
&:after {
|
|
188
|
-
top: calc(50% + 1px);
|
|
189
|
-
border-top-width: 4px;
|
|
190
|
-
border-bottom-width: 0;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// -- MENU
|
|
194
|
-
// Now we can style the visual appearance of the select menu;
|
|
195
|
-
// ------------------------------------------------------------------------
|
|
196
|
-
> select {
|
|
197
|
-
// [1] Reset the appearance
|
|
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);
|
|
211
|
-
outline: 0;
|
|
212
|
-
font-size: var(--fs-body1);
|
|
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
|
-
}
|
|
229
|
-
|
|
230
|
-
// -- INCREASE FONT SIZE FOR MOBILE SAFARI
|
|
231
|
-
// This keeps our inputs from zooming the page while focused
|
|
232
|
-
// ------------------------------------------------------------------------
|
|
233
|
-
@supports (-webkit-overflow-scrolling: touch) {
|
|
234
|
-
font-size: 16px;
|
|
235
|
-
padding: 0.4em 0.55em; // Compensate for the larger font size so we generally keep the input the same size
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// -- STYLE AUTOFILL STATES
|
|
239
|
-
@autofill();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
// ============================================================================
|
|
245
|
-
// $ CHECKBOXES & RADIOS
|
|
246
|
-
// ----------------------------------------------------------------------------
|
|
247
|
-
// TODO would _love_ to use .s-check instead, with no class on the input itself
|
|
248
|
-
.s-check-control {
|
|
249
|
-
display: flex;
|
|
250
|
-
gap: var(--su8);
|
|
251
|
-
align-items: center;
|
|
252
|
-
|
|
253
|
-
[disabled] + .s-label {
|
|
254
|
-
&:extend(.is-disabled .s-label);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.s-label {
|
|
258
|
-
font-weight: normal;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.s-check-group {
|
|
263
|
-
display: flex;
|
|
264
|
-
flex-direction: column;
|
|
265
|
-
gap: var(--su8);
|
|
266
|
-
|
|
267
|
-
&&__horizontal {
|
|
268
|
-
flex-direction: row;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// TODO HACK? <legend> isn't respecting gap...
|
|
272
|
-
legend.s-label {
|
|
273
|
-
margin-bottom: var(--su8);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// manually align the checkboxes and radios to the top of the group
|
|
277
|
-
.s-check-control {
|
|
278
|
-
align-items: flex-start;
|
|
279
|
-
}
|
|
280
|
-
.s-checkbox, .s-radio {
|
|
281
|
-
margin-top: calc(var(--su2) + var(--su1)); // 3px
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.s-checkbox,
|
|
286
|
-
.s-radio {
|
|
287
|
-
// [1] Check to see if we can use custom styles, if so reset the defaults
|
|
288
|
-
// ------------------------------------------------------------------------
|
|
289
|
-
@supports ((-webkit-appearance: none) or (-moz-appearance: none) or (appearance: none)) {
|
|
290
|
-
.appearance(none);
|
|
291
|
-
|
|
292
|
-
&::-ms-check {
|
|
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
|
-
}
|
|
308
|
-
|
|
309
|
-
input& {
|
|
310
|
-
flex-shrink: 0;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// Disabled
|
|
314
|
-
&[disabled] {
|
|
315
|
-
opacity: var(--_o-disabled-static);
|
|
316
|
-
cursor: not-allowed;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// $$ CHECKBOXES
|
|
321
|
-
// ----------------------------------------------------------------------------
|
|
322
|
-
.s-checkbox {
|
|
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
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// $$ RADIOS
|
|
358
|
-
// ----------------------------------------------------------------------------
|
|
359
|
-
.s-radio {
|
|
360
|
-
@supports ((-webkit-appearance: none) or (-moz-appearance: none) or (appearance: none)) {
|
|
361
|
-
border-radius: var(--br-circle);
|
|
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
|
-
}
|
|
373
|
-
|
|
374
|
-
&:focus {
|
|
375
|
-
box-shadow: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// ============================================================================
|
|
381
|
-
// $ STATES
|
|
382
|
-
// The many states for inputs and select menus.
|
|
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;
|
|
391
|
-
|
|
392
|
-
.highcontrast-mode({
|
|
393
|
-
border-color: var(--black);
|
|
394
|
-
})
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.s-input:focus,
|
|
398
|
-
.s-input.has-focus,
|
|
399
|
-
.s-textarea:focus,
|
|
400
|
-
.s-select > select:focus {
|
|
401
|
-
@focus-style();
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// This needs to be separate from the one above, because in browsers that don't support :focus-within
|
|
405
|
-
// it's a syntax error, rendering the whole selector null and void.
|
|
406
|
-
.s-input:focus-within {
|
|
407
|
-
@focus-style();
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.s-input,
|
|
412
|
-
.s-textarea,
|
|
413
|
-
.s-select > select {
|
|
414
|
-
// Disabled
|
|
415
|
-
&[disabled] {
|
|
416
|
-
cursor: not-allowed;
|
|
417
|
-
opacity: var(--_o-disabled-static);
|
|
418
|
-
}
|
|
419
|
-
|
|
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
|
-
.is-readonly & {
|
|
426
|
-
border-color: var(--bc-light);
|
|
427
|
-
background-color: var(--black-050);
|
|
428
|
-
color: var(--black-200);
|
|
429
|
-
cursor: not-allowed;
|
|
430
|
-
|
|
431
|
-
.highcontrast-mode({
|
|
432
|
-
color: var(--fc-light);
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// ============================================================================
|
|
438
|
-
// $ VALIDATION STATES
|
|
439
|
-
// Classes are applied at the wrapping container level.
|
|
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
|
-
}
|
|
451
|
-
|
|
452
|
-
.s-select .s-input-icon {
|
|
453
|
-
right: var(--su32);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
.s-textarea {
|
|
457
|
-
padding-right: var(--su48);
|
|
458
|
-
|
|
459
|
-
~ .s-input-icon {
|
|
460
|
-
top: 1.5em;
|
|
461
|
-
right: 1.5em;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
.s-input-message a {
|
|
466
|
-
text-decoration: underline;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// $$ WARNING
|
|
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
|
-
|
|
488
|
-
a {
|
|
489
|
-
color: var(--yellow-900);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.s-input-icon {
|
|
494
|
-
color: var(--yellow-600);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
// $$ ERROR
|
|
499
|
-
// ----------------------------------------------------------------------------
|
|
500
|
-
.has-error {
|
|
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
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
.s-input-message {
|
|
514
|
-
color: var(--red-500);
|
|
515
|
-
|
|
516
|
-
a {
|
|
517
|
-
color: var(--red-800);
|
|
518
|
-
|
|
519
|
-
&:hover {
|
|
520
|
-
color: var(--red-900);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
.s-input-icon {
|
|
526
|
-
color: var(--red-400);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// $$ SUCCESS
|
|
531
|
-
// ----------------------------------------------------------------------------
|
|
532
|
-
.has-success {
|
|
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
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
.s-input-message {
|
|
546
|
-
color: var(--green-500);
|
|
547
|
-
|
|
548
|
-
a {
|
|
549
|
-
color: var(--green-800);
|
|
550
|
-
|
|
551
|
-
&:hover {
|
|
552
|
-
color: var(--green-900);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
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
|
-
|
|
600
|
-
&.s-input-icon__search,
|
|
601
|
-
&.s-input-icon__creditcard {
|
|
602
|
-
right: auto;
|
|
603
|
-
left: 0.7em;
|
|
604
|
-
color: var(--black-400);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
// $$ MESSAGE
|
|
609
|
-
// Set some baseline styles
|
|
610
|
-
// ----------------------------------------------------------------------------
|
|
611
|
-
.s-input-message {
|
|
612
|
-
padding: var(--su2);
|
|
613
|
-
font-size: var(--fs-caption);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// $$ PADDING ADJUSTMENTS AND SIZES
|
|
617
|
-
// ----------------------------------------------------------------------------
|
|
618
|
-
.s-input__sm,
|
|
619
|
-
.s-textarea__sm,
|
|
620
|
-
.s-select__sm > select {
|
|
621
|
-
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
|
-
}
|
|
666
|
-
}
|