@stackoverflow/stacks 3.0.0-beta.3 → 3.0.0-beta.5

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