@stackoverflow/stacks 2.5.7 → 2.6.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.
@@ -1,474 +1,476 @@
1
- .s-btn {
2
- // BASE COMPONENT-SPECIFIC CUSTOM PROPERTIES
3
- --_bu-baw: var(--su-static1);
4
- --_bu-bc: transparent;
5
- // --_bu-bg: inherit; // [1]
6
- --_bu-br: var(--br-md);
7
- --_bu-fc: var(--theme-button-color, var(--theme-secondary-400));
8
- --_bu-fs: var(--fs-body1);
9
- --_bu-p: 0.8em;
10
-
11
- // Active
12
- --_bu-bc-active: var(--_bu-bc);
13
- --_bu-bg-active: var(--theme-button-active-background-color, var(--theme-secondary-300));
14
- --_bu-fc-active: var(--theme-button-hover-color, var(--theme-secondary-500)); // Note: hover color used on purpose
15
-
16
- // Hover
17
- --_bu-bc-hover: var(--_bu-bc);
18
- --_bu-bg-hover: var(--theme-button-hover-background-color, var(--theme-secondary-200));
19
- --_bu-fc-hover: var(--theme-button-hover-color, var(--theme-secondary-500));
20
-
21
- // BASE SELECTED MODIFIER
22
- --_bu-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
23
- --_bu-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
24
-
25
- // FILLED VARIANT
26
- --_bu-filled-bc: transparent;
27
- --_bu-filled-bg: var(--theme-button-primary-background-color, var(--theme-secondary-400));
28
- --_bu-filled-fc: var(--theme-button-primary-color, var(--white));
29
- // Filled + Selected
30
- --_bu-filled-bc-selected: transparent;
31
- --_bu-filled-bg-selected: var(--theme-button-primary-selected-background-color, var(--theme-secondary-500));
32
- --_bu-filled-fc-selected: var(--theme-button-primary-selected-color, var(--white));
33
- // Filled + Active
34
- --_bu-filled-bc-active: var(--_bu-filled-bc);
35
- --_bu-filled-bg-active: var(--theme-button-primary-active-background-color, var(--theme-secondary-600));
36
- --_bu-filled-fc-active: var(--theme-button-primary-hover-color, var(--white));
37
- // Filled + Hover
38
- --_bu-filled-bc-hover: var(--_bu-filled-bc);
39
- --_bu-filled-bg-hover: var(--theme-button-primary-hover-background-color, var(--theme-secondary-500));
40
- --_bu-filled-fc-hover: var(--theme-button-primary-hover-color, var(--white));
41
-
42
- // OUTLINED VARIANT
43
- --_bu-outlined-bc: var(--theme-button-outlined-border-color, var(--theme-secondary-400));
44
- --_bu-outlined-bg: var(--theme-button-outlined-background-color);
45
- --_bg-outlined-fc: var(--theme-button-outlined-color, var(--theme-secondary-400));
46
- // Outlined + Selected
47
- --_bu-outlined-bc-selected: var(--theme-button-outlined-selected-border-color, var(--theme-secondary-400));
48
- --_bu-outlined-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
49
- --_bu-outlined-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
50
-
51
- // CHILD COMPONENT CUSTOM PROPERTIES
52
- --_bu-badge-o: 0.5;
53
- --_bu-dropdown-bw: var(--su-static4);
54
- --_bu-number-fc: var(--white);
55
- --_bu-number-fc-filled: var(--theme-button-primary-number-color, var(--theme-secondary-600));
56
- --_bu-number-fc-selected: var(--white);
57
-
58
- // CONTEXTUAL STYLES
59
- .highcontrast-mode({
60
- --_bu-bc: currentColor;
61
- --_bu-outlined-bc: var(--_bu-bc);
62
- --_bu-bc-selected: var(--_bu-bc);
63
- --_bu-fc-selected: var(--white);
64
- --_bu-outlined-fc-selected: var(--white);
65
- --_bu-badge-o: 0.8;
66
- --_bu-number-fc-selected: var(--theme-button-primary-number-color, var(--theme-secondary-600));
67
- });
68
-
69
- // STATES
70
- fieldset[disabled] &,
71
- &[disabled],
72
- &[aria-disabled="true"] {
73
- opacity: var(--_o-disabled-static);
74
- pointer-events: none;
75
- text-decoration: none;
76
- }
77
-
78
- button &,
79
- button[type="submit"] &,
80
- button[type="reset"] & {
81
- -webkit-appearance: button; // [2]
82
- }
83
-
84
- &.grid {
85
- display: flex; // Override &&__danger buttons having inline-block by default
86
- }
87
-
88
- &.is-loading {
89
- .svg-icon:first-child {
90
- margin-left: calc((var(--su-static24) - var(--su-static1)) * -1); // -23px
91
- opacity: 0; // [3]
92
- }
93
-
94
- padding-left: 2.2em;
95
- }
96
-
97
- &.is-selected,
98
- &--radio:checked + & {
99
- background-color: var(--_bu-bg-selected);
100
- border-color: var(--_bu-bc-selected, transparent);
101
- color: var(--_bu-fc-selected);
102
-
103
- .s-btn--number {
104
- color: var(--_bu-number-fc-selected);
105
- }
106
-
107
- &.s-btn__filled { // this needs to live here to adapt to radio button-group
108
- border-color: var(--_bu-filled-bc-selected);
109
- background-color: var(--_bu-filled-bg-selected);
110
- color: var(--_bu-filled-fc-selected);
111
- }
112
- &.s-btn__outlined { // this needs to live here to adapt to radio button-group
113
- border-color: var(--_bu-outlined-bc-selected);
114
- background-color: var(--_bu-outlined-bg-selected);
115
- color: var(--_bu-outlined-fc-selected);
116
-
117
- &.s-btn__muted {
118
- .highcontrast-mode({
119
- --_bu-outlined-bc-selected: var(--_bu-filled-bc-selected);
120
- --_bu-outlined-bg-selected: var(--_bu-filled-bg-selected);
121
- --_bu-outlined-fc-selected: var(--_bu-filled-fc-selected);
122
- --_bu-number-fc-selected: var(--_bu-filled-bg-selected);
123
- });
124
- }
125
- }
126
- }
127
-
128
- // MODIFIERS
129
- &&__filled {
130
- .s-btn--number {
131
- color: var(--_bu-number-fc-filled);
132
- }
133
-
134
- border-color: var(--_bu-filled-bc);
135
- background-color: var(--_bu-filled-bg);
136
- color: var(--_bu-filled-fc);
137
- }
138
-
139
- &&__outlined {
140
- border-color: var(--_bu-outlined-bc);
141
- background-color: var(--_bu-outlined-bg, inherit);
142
- }
143
-
144
- // Resets
145
- &&__link,
146
- &&__unset {
147
- --_bu-baw: 0;
148
- --_bu-br: 0;
149
- --_bu-p: 0;
150
-
151
- &:focus,
152
- &:focus-visible {
153
- outline-style: auto;
154
- }
155
- }
156
-
157
- &&__link {
158
- &,
159
- &:hover,
160
- &:active,
161
- &:focus,
162
- &[disabled],
163
- &[aria-disabled="true"] {
164
- --_bu-bg: none;
165
- }
166
-
167
- &.s-btn__dropdown {
168
- padding-right: 0.9em;
169
- }
170
-
171
- .s-link();
172
- display: inline;
173
- font: inherit;
174
- outline: revert;
175
- text-align: inherit;
176
- }
177
-
178
- &&__unset {
179
- &,
180
- &:hover,
181
- &:active,
182
- &:focus {
183
- --_bu-bg: none;
184
- --_bu-fc: unset;
185
-
186
- cursor: default;
187
- font: unset;
188
- user-select: auto;
189
- }
190
-
191
- outline: initial;
192
- }
193
-
194
- // Pseudo-elements and child-based modifiers
195
- &&__dropdown {
196
- &:after {
197
- border-color: currentColor transparent;
198
- border-style: solid;
199
- border-width: var(--_bu-dropdown-bw);
200
- border-bottom-width: 0;
201
- content: "";
202
- pointer-events: none;
203
- position: absolute;
204
- right: var(--_bu-px, var(--_bu-p));
205
- top: calc(50% - var(--su-static2));
206
- z-index: var(--zi-active);
207
- }
208
-
209
- padding-right: calc(var(--_bu-px, var(--_bu-p)) * 2.5);
210
- }
211
-
212
- &&__icon {
213
- .svg-icon {
214
- vertical-align: baseline;
215
- margin-top: -0.3em; // [4]
216
- margin-bottom: -0.3em; // [4]
217
- transition: opacity 200ms var(--te-smooth); // Animate the transition to .is-loading
218
- }
219
- }
220
-
221
- // Size
222
- &&__xs {
223
- .size-styles(xs; bu; @styles: fs);
224
- --_bu-dropdown-bw: calc(var(--su-static4) - var(--su-static1));
225
- --_bu-p: 0.6em;
226
- }
227
-
228
- &&__sm {
229
- .size-styles(sm; bu; @styles: fs);
230
- }
231
-
232
- &&__md {
233
- .size-styles(md; bu; @styles: br, fs);
234
- --_bu-p: 0.7em;
235
- }
236
-
237
- // VARIANTS
238
- &&__danger,
239
- &&__muted {
240
- .highcontrast-mode({
241
- --_bu-filled-bc: transparent;
242
- });
243
- }
244
-
245
- &&__danger {
246
- --_bu-bg-active: var(--red-300);
247
- --_bu-bg-hover: var(--red-200);
248
- --_bu-bg-selected: var(--red-300);
249
- --_bu-fc: var(--red-500);
250
- --_bu-fc-active: var(--_bu-fc);
251
- --_bu-fc-hover: var(--red-500);
252
- --_bu-fc-selected: var(--red-600);
253
- --_bu-filled-bc: transparent;
254
- --_bu-filled-bc-selected: var(--_bu-filled-bc);
255
- --_bu-filled-bg: var(--red-400);
256
- --_bu-filled-bg-active: var(--red-500);
257
- --_bu-filled-bg-hover: var(--red-500);
258
- --_bu-filled-bg-selected: var(--red-600);
259
- --_bu-filled-fc: var(--white);
260
- --_bu-filled-fc-active: var(--_bu-filled-fc);
261
- --_bu-filled-fc-hover: var(--_bu-filled-fc);
262
- --_bu-filled-fc-selected: var(--_bu-filled-fc);
263
- --_bu-outlined-bc: var(--red-400);
264
- --_bu-outlined-bc-selected: var(--red-500);
265
- --_bu-outlined-bg-selected: var(--_bu-bg-selected);
266
- --_bu-outlined-fc-selected: var(--_bu-fc-selected);
267
- --_bu-number-fc: var(--white);
268
- --_bu-number-fc-filled: var(--black);
269
- }
270
-
271
- &&__muted {
272
- --_bu-bc-hover: var(--black-300);
273
- --_bu-bg-active: var(--black-150);
274
- --_bu-bg-hover: var(--black-100);
275
- --_bu-bg-selected: var(--black-200);
276
- --_bu-fc: var(--black-500);
277
- --_bu-fc-active: var(--_bu-fc);
278
- --_bu-fc-hover: var(--black-500);
279
- --_bu-fc-selected: var(--black-500);
280
- // The filled modifier on the muted button is deprecated and is to be
281
- // removed in Stacks Classic v2
282
- --_bu-filled-bc: transparent;
283
- --_bu-filled-bc-selected: var(--_bu-filled-bc);
284
- --_bu-filled-bg: var(--black-225);
285
- --_bu-filled-bg-active: var(--black-300);
286
- --_bu-filled-bg-hover: var(--black-250);
287
- --_bu-filled-bg-selected: var(--black-350);
288
- --_bu-filled-fc: var(--black-500);
289
- --_bu-filled-fc-active: var(--_bu-filled-fc);
290
- --_bu-filled-fc-hover: var(--_bu-filled-fc);
291
- --_bu-filled-fc-selected: var(--black-600);
292
- --_bu-outlined-bc: var(--black-300);
293
- --_bu-outlined-bc-selected: var(--black-300);
294
- --_bu-outlined-bg-selected: var(--_bu-bg-selected);
295
- --_bu-outlined-fc-selected: var(--_bu-fc-selected);
296
- --_bu-number-fc-filled: var(--white);
297
- --_bu-number-fc-selected: var(--white);
298
- --_bu-bg-focus: var(--black-400);
299
- --_bu-fc-focus: var(--white);
300
- --_bu-number-fc-focus: var(--black-500);
301
-
302
- .highcontrast-mode({
303
- --_bu-bg-hover: var(--black-225);
304
- // // The filled modifier on the muted button is deprecated and is to be
305
- // // removed in Stacks Classic v2
306
- --_bu-filled-bg: var(--black-400);
307
- --_bu-filled-bg-active: var(--black-500);
308
- --_bu-filled-bg-hover: var(--black-400);
309
- --_bu-filled-bg-selected: var(--black-500);
310
- --_bu-filled-fc: var(--white);
311
- --_bu-filled-fc-selected: var(--_bu-filled-fc);
312
- --_bu-fc-selected: var(--black);
313
- --_bu-number-fc: var(--white);
314
- --_bu-number-fc-filled: var(--black);
315
- --_bu-number-fc-selected: var(--white);
316
- });
317
- }
318
-
319
- // Social
320
- &&__facebook,
321
- &&__github {
322
- .highcontrast-mode({
323
- --_bu-bc: transparent;
324
- });
325
- }
326
-
327
- &&__facebook {
328
- @_fb-brand: #385499;
329
- --_bu-bc: transparent;
330
- --_bu-bg: @_fb-brand;
331
- --_bu-bg-active: darken(@_fb-brand, 10%);
332
- --_bu-bg-hover: darken(@_fb-brand, 5%);
333
- --_bu-fc: #fff;
334
- --_bu-fc-active: var(--_bu-fc);
335
- --_bu-fc-hover: var(--_bu-fc);
336
- --_bu-hc-bc: transparent;
337
- }
338
-
339
- &&__google {
340
- --_bu-bc: var(--bc-medium);
341
- --_bu-bg: var(--white);
342
- --_bu-bg-active: var(--black-150);
343
- --_bu-bg-hover: var(--black-100);
344
- --_bu-fc: var(--fc-medium);
345
- --_bu-fc-active: var(--fc-dark);
346
- --_bu-fc-hover: var(--black-600);
347
- }
348
-
349
- &&__github {
350
- --_bu-bg: var(--black-600);
351
- --_bu-bg-active: var(--black);
352
- --_bu-bg-hover: var(--black-600);
353
- --_bu-fc: var(--white);
354
- --_bu-fc-active: var(--white);
355
- --_bu-fc-hover: var(--white);
356
- --_bu-hc-bc: transparent;
357
- }
358
-
359
- // CHILD ELEMENTS
360
- & &--badge {
361
- opacity: var(--_bu-badge-o);
362
- display: inline-block;
363
- border-radius: var(--br-sm);
364
- padding: var(--su2) calc(var(--su4) - var(--su1));
365
- font-size: var(--fs-caption);
366
- line-height: var(--lh-xs);
367
- background-color: currentColor;
368
- }
369
-
370
- & &--number {
371
- color: var(--_bu-number-fc);
372
- }
373
-
374
- &--radio { // This lives alongside a .s-btn element. These styles are the equivelent of `.v-visible-sr`
375
- border: 0;
376
- clip-path: inset(50%);
377
- clip: rect(var(--su-static1), var(--su-static1), var(--su-static1), var(--su-static1)); // rect(1px, 1px, 1px, 1px)
378
- height: var(--su-static1);
379
- margin: calc(var(--su-static1) * -1); // -1px
380
- overflow-wrap: normal;
381
- overflow: hidden;
382
- padding: 0;
383
- position: absolute;
384
- width: var(--su-static1);
385
- }
386
-
387
- // INTERACTION
388
- &:not(&__link):not(&__unset):focus-visible,
389
- &--radio:focus-visible + & {
390
- .focus-styles(true, true);
391
- }
392
-
393
- &:not(&--radio:checked + label):not(&__link):not(&__unset):not(&__facebook):not(&__github):not(&__google):not(.is-selected) {
394
- &:focus-visible,
395
- &.focus-inset-bordered {
396
- &:not(:hover) .s-btn--number {
397
- color: var(--_bu-number-fc-focus, var(--_bu-number-fc-filled));
398
- }
399
-
400
- background-color: var(--_bu-bg-focus, var(--_bu-filled-bg));
401
- color: var(--_bu-fc-focus, var(--_bu-filled-fc));
402
- }
403
-
404
- &:hover {
405
- &.s-btn__filled {
406
- background-color: var(--_bu-filled-bg-hover);
407
- border-color: var(--_bu-filled-bc-hover);
408
- color: var(--_bu-filled-fc-hover);
409
- }
410
-
411
- &:not(.s-btn__outlined) {
412
- border-color: var(--_bu-bc-hover);
413
- }
414
-
415
- &:visited:not(:active):not(:focus) {
416
- &.s-btn__filled {
417
- background-color: var(--_bu-filled-bg);
418
- border-color: var(--_bu-filled-bc);
419
- color: var(--_bu-filled-fc);
420
- }
421
-
422
- background-color: var(--_bu-bg);
423
- border-color: var(--_bu-bc);
424
- color: var(--_bu-fc);
425
- }
426
-
427
- background-color: var(--_bu-bg-hover);
428
- color: var(--_bu-fc-hover);
429
- }
430
-
431
- &:active {
432
- &.s-btn__filled {
433
- background-color: var(--_bu-filled-bg-active);
434
- border-color: var(--_bu-filled-bc-active);
435
- color: var(--_bu-filled-fc-active);
436
- }
437
-
438
- background-color: var(--_bu-bg-active);
439
- border-color: var(--_bu-bc-active);
440
- color: var(--_bu-fc-active);
441
- }
442
- }
443
-
444
- background-color: var(--_bu-bg, inherit); // [1]
445
- border: var(--_bu-baw) solid var(--_bu-bc);
446
- border-radius: var(--_bu-br);
447
- box-shadow: none;
448
- color: var(--_bu-fc);
449
- font-size: var(--_bu-fs);
450
- padding: var(--_bu-py, var(--_bu-p)) var(--_bu-px, var(--_bu-p));
451
-
452
- cursor: pointer;
453
- display: inline-block;
454
- font-family: inherit;
455
- font-weight: normal;
456
- line-height: var(--lh-sm);
457
- position: relative;
458
- outline: none;
459
- text-align: center;
460
- text-decoration: none;
461
- user-select: none;
462
- }
463
-
464
- // [1] Passing `inherit` as a custom property value has no effect, instead we
465
- // provide it as a fallback value for when --_bu-bg is not defined
466
- // For more info, see https://stackoverflow.com/a/53239881/652353
467
- // [2] Guard against the difference in configurable resets
468
- // Eric Meyer's reset does not include this, while normalize.css does
469
- // Correct the inability to style buttons in iOS and Safari.
470
- // [3] If the first thing in the button is an icon, let's hide it on loading
471
- // We only want to modify the visibility, since we still want it to have shape and keep the same layout.
472
- // [4] Most svg icons are 18px tall, but the button's line-height is 1 (13px).
473
- // This means we need to off set the margin y-axis so we don't add
1
+ .s-btn {
2
+ // BASE COMPONENT-SPECIFIC CUSTOM PROPERTIES
3
+ --_bu-baw: var(--su-static1);
4
+ --_bu-bc: transparent;
5
+ // --_bu-bg: inherit; // [1]
6
+ --_bu-br: var(--br-md);
7
+ --_bu-fc: var(--theme-button-color, var(--theme-secondary-400));
8
+ --_bu-fs: var(--fs-body1);
9
+ --_bu-p: 0.8em;
10
+
11
+ // Active
12
+ --_bu-bc-active: var(--_bu-bc);
13
+ --_bu-bg-active: var(--theme-button-active-background-color, var(--theme-secondary-300));
14
+ --_bu-fc-active: var(--theme-button-hover-color, var(--theme-secondary-500)); // Note: hover color used on purpose
15
+
16
+ // Hover
17
+ --_bu-bc-hover: var(--_bu-bc);
18
+ --_bu-bg-hover: var(--theme-button-hover-background-color, var(--theme-secondary-200));
19
+ --_bu-fc-hover: var(--theme-button-hover-color, var(--theme-secondary-500));
20
+
21
+ // BASE SELECTED MODIFIER
22
+ --_bu-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
23
+ --_bu-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
24
+
25
+ // FILLED VARIANT
26
+ --_bu-filled-bc: transparent;
27
+ --_bu-filled-bg: var(--theme-button-primary-background-color, var(--theme-secondary-400));
28
+ --_bu-filled-fc: var(--theme-button-primary-color, var(--white));
29
+ // Filled + Selected
30
+ --_bu-filled-bc-selected: transparent;
31
+ --_bu-filled-bg-selected: var(--theme-button-primary-selected-background-color, var(--theme-secondary-500));
32
+ --_bu-filled-fc-selected: var(--theme-button-primary-selected-color, var(--white));
33
+ // Filled + Active
34
+ --_bu-filled-bc-active: var(--_bu-filled-bc);
35
+ --_bu-filled-bg-active: var(--theme-button-primary-active-background-color, var(--theme-secondary-600));
36
+ --_bu-filled-fc-active: var(--theme-button-primary-hover-color, var(--white));
37
+ // Filled + Hover
38
+ --_bu-filled-bc-hover: var(--_bu-filled-bc);
39
+ --_bu-filled-bg-hover: var(--theme-button-primary-hover-background-color, var(--theme-secondary-500));
40
+ --_bu-filled-fc-hover: var(--theme-button-primary-hover-color, var(--white));
41
+
42
+ // OUTLINED VARIANT
43
+ --_bu-outlined-bc: var(--theme-button-outlined-border-color, var(--theme-secondary-400));
44
+ --_bu-outlined-bg: var(--theme-button-outlined-background-color);
45
+ --_bg-outlined-fc: var(--theme-button-outlined-color, var(--theme-secondary-400));
46
+ // Outlined + Selected
47
+ --_bu-outlined-bc-selected: var(--theme-button-outlined-selected-border-color, var(--theme-secondary-400));
48
+ --_bu-outlined-bg-selected: var(--theme-button-selected-background-color, var(--theme-secondary-300));
49
+ --_bu-outlined-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
50
+
51
+ // CHILD COMPONENT CUSTOM PROPERTIES
52
+ --_bu-badge-o: 0.5;
53
+ --_bu-dropdown-bw: var(--su-static4);
54
+ --_bu-number-fc: var(--white);
55
+ --_bu-number-fc-filled: var(--theme-button-primary-number-color, var(--theme-secondary-600));
56
+ --_bu-number-fc-selected: var(--white);
57
+
58
+ // CONTEXTUAL STYLES
59
+ .highcontrast-mode({
60
+ --_bu-bc: currentColor;
61
+ --_bu-outlined-bc: var(--_bu-bc);
62
+ --_bu-bc-selected: var(--_bu-bc);
63
+ --_bu-fc-selected: var(--white);
64
+ --_bu-outlined-fc-selected: var(--white);
65
+ --_bu-badge-o: 0.8;
66
+ --_bu-number-fc-selected: var(--theme-button-primary-number-color, var(--theme-secondary-600));
67
+ });
68
+
69
+ // STATES
70
+ fieldset[disabled] &,
71
+ &[disabled],
72
+ &[aria-disabled="true"] {
73
+ opacity: var(--_o-disabled-static);
74
+ pointer-events: none;
75
+ text-decoration: none;
76
+ }
77
+
78
+ button &,
79
+ button[type="submit"] &,
80
+ button[type="reset"] & {
81
+ -webkit-appearance: button; // [2]
82
+ }
83
+
84
+ &.grid {
85
+ display: flex; // Override &&__danger buttons having inline-block by default
86
+ }
87
+
88
+ &.is-loading {
89
+ .svg-icon:first-child {
90
+ margin-left: calc((var(--su-static24) - var(--su-static1)) * -1); // -23px
91
+ opacity: 0; // [3]
92
+ }
93
+
94
+ padding-left: 2.2em;
95
+ }
96
+
97
+ &.is-selected,
98
+ &--radio:checked + & {
99
+ background-color: var(--_bu-bg-selected);
100
+ border-color: var(--_bu-bc-selected, transparent);
101
+ color: var(--_bu-fc-selected);
102
+
103
+ .s-btn--number {
104
+ color: var(--_bu-number-fc-selected);
105
+ }
106
+
107
+ &.s-btn__filled { // this needs to live here to adapt to radio button-group
108
+ border-color: var(--_bu-filled-bc-selected);
109
+ background-color: var(--_bu-filled-bg-selected);
110
+ color: var(--_bu-filled-fc-selected);
111
+ }
112
+ &.s-btn__outlined { // this needs to live here to adapt to radio button-group
113
+ border-color: var(--_bu-outlined-bc-selected);
114
+ background-color: var(--_bu-outlined-bg-selected);
115
+ color: var(--_bu-outlined-fc-selected);
116
+
117
+ &.s-btn__muted {
118
+ .highcontrast-mode({
119
+ --_bu-outlined-bc-selected: var(--_bu-filled-bc-selected);
120
+ --_bu-outlined-bg-selected: var(--_bu-filled-bg-selected);
121
+ --_bu-outlined-fc-selected: var(--_bu-filled-fc-selected);
122
+ --_bu-number-fc-selected: var(--_bu-filled-bg-selected);
123
+ });
124
+ }
125
+ }
126
+ }
127
+
128
+ // MODIFIERS
129
+ &&__filled {
130
+ .s-btn--number {
131
+ color: var(--_bu-number-fc-filled);
132
+ }
133
+
134
+ border-color: var(--_bu-filled-bc);
135
+ background-color: var(--_bu-filled-bg);
136
+ color: var(--_bu-filled-fc);
137
+ }
138
+
139
+ &&__outlined {
140
+ border-color: var(--_bu-outlined-bc);
141
+ background-color: var(--_bu-outlined-bg, inherit);
142
+ }
143
+
144
+ // Resets
145
+ &&__link,
146
+ &&__unset {
147
+ --_bu-baw: 0;
148
+ --_bu-br: 0;
149
+ --_bu-p: 0;
150
+
151
+ &:focus,
152
+ &:focus-visible {
153
+ outline-style: auto;
154
+ }
155
+ }
156
+
157
+ &&__link {
158
+ &,
159
+ &:hover,
160
+ &:active,
161
+ &:focus,
162
+ &[disabled],
163
+ &[aria-disabled="true"] {
164
+ --_bu-bg: none;
165
+ }
166
+
167
+ &.s-btn__dropdown {
168
+ padding-right: 0.9em;
169
+ }
170
+
171
+ .s-link();
172
+ display: inline;
173
+ font: inherit;
174
+ outline: revert;
175
+ text-align: inherit;
176
+ }
177
+
178
+ &&__unset {
179
+ &,
180
+ &:hover,
181
+ &:active,
182
+ &:focus {
183
+ --_bu-bg: none;
184
+ --_bu-fc: unset;
185
+
186
+ cursor: default;
187
+ font: unset;
188
+ user-select: auto;
189
+ }
190
+
191
+ outline: initial;
192
+ }
193
+
194
+ // Pseudo-elements and child-based modifiers
195
+ &&__dropdown {
196
+ &:after {
197
+ border-color: currentColor transparent;
198
+ border-style: solid;
199
+ border-width: var(--_bu-dropdown-bw);
200
+ border-bottom-width: 0;
201
+ content: "";
202
+ pointer-events: none;
203
+ position: absolute;
204
+ right: var(--_bu-px, var(--_bu-p));
205
+ top: calc(50% - var(--su-static2));
206
+ z-index: var(--zi-active);
207
+ }
208
+
209
+ padding-right: calc(var(--_bu-px, var(--_bu-p)) * 2.5);
210
+ }
211
+
212
+ &&__icon {
213
+ .svg-icon {
214
+ vertical-align: baseline;
215
+ margin-top: -0.3em; // [4]
216
+ margin-bottom: -0.3em; // [4]
217
+ transition: opacity 200ms var(--te-smooth); // Animate the transition to .is-loading
218
+ }
219
+ }
220
+
221
+ // Size
222
+ &&__xs {
223
+ .size-styles(xs; bu; @styles: fs);
224
+ --_bu-dropdown-bw: calc(var(--su-static4) - var(--su-static1));
225
+ --_bu-p: 0.6em;
226
+ }
227
+
228
+ &&__sm {
229
+ .size-styles(sm; bu; @styles: fs);
230
+ }
231
+
232
+ &&__md {
233
+ .size-styles(md; bu; @styles: br, fs);
234
+ --_bu-p: 0.7em;
235
+ }
236
+
237
+ // VARIANTS
238
+ &&__danger,
239
+ &&__muted {
240
+ .highcontrast-mode({
241
+ --_bu-filled-bc: transparent;
242
+ });
243
+ }
244
+
245
+ &&__danger {
246
+ --_bu-bg-active: var(--red-300);
247
+ --_bu-bg-hover: var(--red-200);
248
+ --_bu-bg-selected: var(--red-300);
249
+ --_bu-fc: var(--red-500);
250
+ --_bu-fc-active: var(--_bu-fc);
251
+ --_bu-fc-hover: var(--red-500);
252
+ --_bu-fc-selected: var(--red-600);
253
+ --_bu-filled-bc: transparent;
254
+ --_bu-filled-bc-selected: var(--_bu-filled-bc);
255
+ --_bu-filled-bg: var(--red-400);
256
+ --_bu-filled-bg-active: var(--red-500);
257
+ --_bu-filled-bg-hover: var(--red-500);
258
+ --_bu-filled-bg-selected: var(--red-600);
259
+ --_bu-filled-fc: var(--white);
260
+ --_bu-filled-fc-active: var(--_bu-filled-fc);
261
+ --_bu-filled-fc-hover: var(--_bu-filled-fc);
262
+ --_bu-filled-fc-selected: var(--_bu-filled-fc);
263
+ --_bu-outlined-bc: var(--red-400);
264
+ --_bu-outlined-bc-selected: var(--red-500);
265
+ --_bu-outlined-bg-selected: var(--_bu-bg-selected);
266
+ --_bu-outlined-fc-selected: var(--_bu-fc-selected);
267
+ --_bu-number-fc: var(--white);
268
+ --_bu-number-fc-filled: var(--black);
269
+ }
270
+
271
+ &&__muted {
272
+ --_bu-bc-hover: var(--black-300);
273
+ --_bu-bg-active: var(--black-150);
274
+ --_bu-bg-hover: var(--black-100);
275
+ --_bu-bg-selected: var(--black-200);
276
+ --_bu-fc: var(--black-500);
277
+ --_bu-fc-active: var(--_bu-fc);
278
+ --_bu-fc-hover: var(--black-500);
279
+ --_bu-fc-selected: var(--black-500);
280
+ // The filled modifier on the muted button is deprecated and is to be
281
+ // removed in Stacks Classic v2
282
+ --_bu-filled-bc: transparent;
283
+ --_bu-filled-bc-selected: var(--_bu-filled-bc);
284
+ --_bu-filled-bg: var(--black-225);
285
+ --_bu-filled-bg-active: var(--black-300);
286
+ --_bu-filled-bg-hover: var(--black-250);
287
+ --_bu-filled-bg-selected: var(--black-350);
288
+ --_bu-filled-fc: var(--black-500);
289
+ --_bu-filled-fc-active: var(--_bu-filled-fc);
290
+ --_bu-filled-fc-hover: var(--_bu-filled-fc);
291
+ --_bu-filled-fc-selected: var(--black-600);
292
+ --_bu-outlined-bc: var(--black-300);
293
+ --_bu-outlined-bc-selected: var(--black-300);
294
+ --_bu-outlined-bg-selected: var(--_bu-bg-selected);
295
+ --_bu-outlined-fc-selected: var(--_bu-fc-selected);
296
+ --_bu-number-fc-filled: var(--white);
297
+ --_bu-number-fc-selected: var(--white);
298
+ --_bu-bg-focus: var(--black-400);
299
+ --_bu-fc-focus: var(--white);
300
+ --_bu-number-fc-focus: var(--black-500);
301
+
302
+ .highcontrast-mode({
303
+ --_bu-bg-hover: var(--black-225);
304
+ // // The filled modifier on the muted button is deprecated and is to be
305
+ // // removed in Stacks Classic v2
306
+ --_bu-filled-bg: var(--black-400);
307
+ --_bu-filled-bg-active: var(--black-500);
308
+ --_bu-filled-bg-hover: var(--black-400);
309
+ --_bu-filled-bg-selected: var(--black-500);
310
+ --_bu-filled-fc: var(--white);
311
+ --_bu-filled-fc-selected: var(--_bu-filled-fc);
312
+ --_bu-fc-selected: var(--black);
313
+ --_bu-number-fc: var(--white);
314
+ --_bu-number-fc-filled: var(--black);
315
+ --_bu-number-fc-selected: var(--white);
316
+ });
317
+ }
318
+
319
+ // Social
320
+ &&__facebook,
321
+ &&__github {
322
+ .highcontrast-mode({
323
+ --_bu-bc: transparent;
324
+ });
325
+ }
326
+
327
+ &&__facebook {
328
+ @_fb-brand: #385499;
329
+ --_bu-bc: transparent;
330
+ --_bu-bg: @_fb-brand;
331
+ --_bu-bg-active: darken(@_fb-brand, 10%);
332
+ --_bu-bg-hover: darken(@_fb-brand, 5%);
333
+ --_bu-fc: #fff;
334
+ --_bu-fc-active: var(--_bu-fc);
335
+ --_bu-fc-hover: var(--_bu-fc);
336
+ --_bu-hc-bc: transparent;
337
+ }
338
+
339
+ &&__google {
340
+ --_bu-bc: var(--bc-medium);
341
+ --_bu-bg: var(--white);
342
+ --_bu-bg-active: var(--black-150);
343
+ --_bu-bg-hover: var(--black-100);
344
+ --_bu-fc: var(--fc-medium);
345
+ --_bu-fc-active: var(--fc-dark);
346
+ --_bu-fc-hover: var(--black-600);
347
+ }
348
+
349
+ &&__github {
350
+ --_bu-bg: var(--black-600);
351
+ --_bu-bg-active: var(--black);
352
+ --_bu-bg-hover: var(--black-600);
353
+ --_bu-fc: var(--white);
354
+ --_bu-fc-active: var(--white);
355
+ --_bu-fc-hover: var(--white);
356
+ --_bu-hc-bc: transparent;
357
+ }
358
+
359
+ // CHILD ELEMENTS
360
+ & &--badge {
361
+ opacity: var(--_bu-badge-o);
362
+ display: inline-block;
363
+ border-radius: var(--br-sm);
364
+ padding: var(--su2) calc(var(--su4) - var(--su1));
365
+ font-size: var(--fs-caption);
366
+ line-height: var(--lh-xs);
367
+ background-color: currentColor;
368
+ }
369
+
370
+ & &--number {
371
+ color: var(--_bu-number-fc);
372
+ }
373
+
374
+ &--radio { // This lives alongside a .s-btn element. These styles are the equivelent of `.v-visible-sr`
375
+ border: 0;
376
+ clip-path: inset(50%);
377
+ clip: rect(var(--su-static1), var(--su-static1), var(--su-static1), var(--su-static1)); // rect(1px, 1px, 1px, 1px)
378
+ height: var(--su-static1);
379
+ margin: calc(var(--su-static1) * -1); // -1px
380
+ overflow-wrap: normal;
381
+ overflow: hidden;
382
+ padding: 0;
383
+ position: absolute;
384
+ width: var(--su-static1);
385
+ }
386
+
387
+ // INTERACTION
388
+ &:not(&__link):not(&__unset):focus-visible,
389
+ &--radio:focus-visible + & {
390
+ .focus-styles(true, true);
391
+ }
392
+
393
+ &:not(&--radio:checked + label):not(&__link):not(&__unset):not(&__facebook):not(&__github):not(&__google):not(.is-selected) {
394
+ &:focus-visible,
395
+ &.focus-inset-bordered {
396
+ &:not(:hover) .s-btn--number {
397
+ color: var(--_bu-number-fc-focus, var(--_bu-number-fc-filled));
398
+ }
399
+
400
+ background-color: var(--_bu-bg-focus, var(--_bu-filled-bg));
401
+ color: var(--_bu-fc-focus, var(--_bu-filled-fc));
402
+ }
403
+
404
+ &:hover {
405
+ &.s-btn__filled {
406
+ background-color: var(--_bu-filled-bg-hover);
407
+ border-color: var(--_bu-filled-bc-hover);
408
+ color: var(--_bu-filled-fc-hover);
409
+ }
410
+
411
+ &:not(.s-btn__outlined) {
412
+ border-color: var(--_bu-bc-hover);
413
+ }
414
+
415
+ &:visited:not(:active):not(:focus) {
416
+ &.s-btn__filled {
417
+ background-color: var(--_bu-filled-bg);
418
+ border-color: var(--_bu-filled-bc);
419
+ color: var(--_bu-filled-fc);
420
+ }
421
+
422
+ &:not(.s-btn__outlined) {
423
+ background-color: var(--_bu-bg);
424
+ border-color: var(--_bu-bc);
425
+ color: var(--_bu-fc);
426
+ }
427
+ }
428
+
429
+ background-color: var(--_bu-bg-hover);
430
+ color: var(--_bu-fc-hover);
431
+ }
432
+
433
+ &:active {
434
+ &.s-btn__filled {
435
+ background-color: var(--_bu-filled-bg-active);
436
+ border-color: var(--_bu-filled-bc-active);
437
+ color: var(--_bu-filled-fc-active);
438
+ }
439
+
440
+ background-color: var(--_bu-bg-active);
441
+ border-color: var(--_bu-bc-active);
442
+ color: var(--_bu-fc-active);
443
+ }
444
+ }
445
+
446
+ background-color: var(--_bu-bg, inherit); // [1]
447
+ border: var(--_bu-baw) solid var(--_bu-bc);
448
+ border-radius: var(--_bu-br);
449
+ box-shadow: none;
450
+ color: var(--_bu-fc);
451
+ font-size: var(--_bu-fs);
452
+ padding: var(--_bu-py, var(--_bu-p)) var(--_bu-px, var(--_bu-p));
453
+
454
+ cursor: pointer;
455
+ display: inline-block;
456
+ font-family: inherit;
457
+ font-weight: normal;
458
+ line-height: var(--lh-sm);
459
+ position: relative;
460
+ outline: none;
461
+ text-align: center;
462
+ text-decoration: none;
463
+ user-select: none;
464
+ }
465
+
466
+ // [1] Passing `inherit` as a custom property value has no effect, instead we
467
+ // provide it as a fallback value for when --_bu-bg is not defined
468
+ // For more info, see https://stackoverflow.com/a/53239881/652353
469
+ // [2] Guard against the difference in configurable resets
470
+ // Eric Meyer's reset does not include this, while normalize.css does
471
+ // Correct the inability to style buttons in iOS and Safari.
472
+ // [3] If the first thing in the button is an icon, let's hide it on loading
473
+ // We only want to modify the visibility, since we still want it to have shape and keep the same layout.
474
+ // [4] Most svg icons are 18px tall, but the button's line-height is 1 (13px).
475
+ // This means we need to off set the margin y-axis so we don't add
474
476
  // additional height to the button.