@stackoverflow/stacks 3.0.0-beta.2 → 3.0.0-beta.20

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.
Files changed (59) hide show
  1. package/dist/css/stacks.css +5981 -5916
  2. package/dist/css/stacks.min.css +1 -1
  3. package/lib/atomic/flex.less +6 -34
  4. package/lib/atomic/height.less +22 -0
  5. package/lib/atomic/misc.less +21 -15
  6. package/lib/atomic/positioning.less +34 -0
  7. package/lib/atomic/sizing.less +76 -0
  8. package/lib/atomic/spacing.less +35 -75
  9. package/lib/atomic/typography.less +52 -13
  10. package/lib/atomic/width.less +27 -0
  11. package/lib/base/body.less +2 -4
  12. package/lib/base/configuration-static.less +3 -3
  13. package/lib/base/internal.less +3 -5
  14. package/lib/base/reset-normalize.less +1 -1
  15. package/lib/components/activity-indicator/activity-indicator.less +1 -17
  16. package/lib/components/avatar/avatar.less +2 -2
  17. package/lib/components/badge/badge.less +179 -173
  18. package/lib/components/banner/banner.less +1 -1
  19. package/lib/components/bling/bling.less +130 -0
  20. package/lib/components/button/button.less +224 -375
  21. package/lib/components/button-group/button-group.less +2 -1
  22. package/lib/components/checkbox_radio/checkbox_radio.less +195 -113
  23. package/lib/components/code-block/code-block.fixtures.ts +2 -2
  24. package/lib/components/code-block/code-block.less +1 -1
  25. package/lib/components/description/description.less +15 -1
  26. package/lib/components/empty-state/empty-state.less +17 -6
  27. package/lib/components/form-group/form-group.less +25 -0
  28. package/lib/components/input-icon/input-icon.less +3 -3
  29. package/lib/components/input_textarea/input_textarea.less +71 -58
  30. package/lib/components/menu/menu.less +83 -21
  31. package/lib/components/modal/modal.less +10 -10
  32. package/lib/components/navigation/navigation.less +62 -37
  33. package/lib/components/notice/notice.less +82 -73
  34. package/lib/components/pagination/pagination.less +44 -43
  35. package/lib/components/popover/popover.less +8 -10
  36. package/lib/components/post-summary/post-summary.less +6 -5
  37. package/lib/components/progress-bar/progress-bar.less +1 -1
  38. package/lib/components/prose/prose.less +5 -5
  39. package/lib/components/select/select.less +26 -37
  40. package/lib/components/sidebar-widget/sidebar-widget.less +2 -2
  41. package/lib/components/table/table.less +0 -8
  42. package/lib/components/tag/tag.less +69 -71
  43. package/lib/components/toast/toast.less +1 -2
  44. package/lib/components/topbar/topbar.less +4 -4
  45. package/lib/components/user-card/user-card.less +118 -92
  46. package/lib/components/vote/vote.less +134 -0
  47. package/lib/exports/color-sets.less +78 -77
  48. package/lib/exports/constants-helpers.less +4 -8
  49. package/lib/exports/constants-type.less +18 -36
  50. package/lib/exports/mixins.less +71 -0
  51. package/lib/stacks-static.less +7 -5
  52. package/lib/tsconfig.json +1 -1
  53. package/package.json +1 -1
  54. package/lib/atomic/width-height.less +0 -194
  55. package/lib/components/award-bling/award-bling.less +0 -32
  56. package/lib/components/check-control/check-control.less +0 -17
  57. package/lib/components/check-group/check-group.less +0 -19
  58. package/lib/components/skeleton/skeleton.less +0 -73
  59. package/lib/exports/spacing-mixins.less +0 -67
@@ -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: var(--red-600);
72
+ --_bu-bc-disabled: var(--red-300);
73
+ });
91
74
  }
92
-
93
- padding-left: 2.2em;
94
75
  }
95
76
 
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);
77
+ &&__featured {
78
+ --_bu-bg: var(--purple-400);
79
+ --_bu-bg-disabled: var(--purple-200);
80
+ --_bu-bg-hover: var(--purple-500);
81
+ --_bu-bg-selected: var(--purple-500);
82
+ --_bu-fc: var(--white);
83
+ --_bu-fc-selected: var(--_bu-fc);
84
+ --_bu-badge-bg: var(--purple-100);
85
+ --_bu-badge-fc: var(--purple-400);
86
+ --_bu-badge-bg-disabled: var(--white);
87
+ --_bu-badge-fc-disabled: var(--purple-200);
88
+ }
101
89
 
102
- .s-btn--number {
103
- color: var(--_bu-number-fc-selected);
104
- }
90
+ &&__tonal {
91
+ --_bu-bg: var(--black-150);
92
+ --_bu-bg-disabled: var(--black-100);
93
+ --_bu-bg-hover: var(--black-200);
94
+ --_bu-fc: var(--black);
95
+ --_bu-fc-disabled: var(--black-300);
96
+ --_bu-fc-selected: var(--_bu-fc);
97
+ --_bu-badge-bg: var(--black-500);
98
+ --_bu-badge-fc: var(--white);
99
+ --_bu-badge-bg-disabled: var(--black-300);
100
+ --_bu-badge-fc-disabled: var(--white);
105
101
 
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
- }
102
+ .highcontrast-mode({
103
+ --_bu-bc: var(--black-300);
104
+ });
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,213 +189,69 @@
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
193
  }
270
194
 
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
- }
346
-
347
- // Social
348
- &&__facebook,
349
- &&__github {
350
- .highcontrast-mode({
351
- --_bu-bc: transparent;
195
+ &.is-selected,
196
+ .s-btn--radio:checked + & {
197
+ --_bu-bg-selected-overlay-o: 20%;
198
+ --_bu-bg-selected-overlay: color-mix(
199
+ in srgb,
200
+ var(--_bu-bg-selected, var(--_bu-bg)),
201
+ var(--white) var(--_bu-bg-selected-overlay-o)
202
+ );
203
+ --_bu-bg-gradient-top: var(--_bu-bg-selected, var(--_bu-bg));
204
+ --_bu-bg-gradient-bottom: var(--_bu-bg-selected-overlay, var(--_bu-bg));
205
+
206
+ .dark-mode({
207
+ --_bu-bg-selected-overlay-o: 13%;
208
+ --_bu-bg-gradient-top: var(--_bu-bg-selected-overlay, var(--_bu-bg));
209
+ --_bu-bg-gradient-bottom: var(--_bu-bg-selected, var(--_bu-bg));
352
210
  });
353
- }
354
211
 
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
- }
212
+ .s-btn--badge {
213
+ .s-btn--number {
214
+ color: var(--_bu-badge-fc, var(--_bu-fc));
215
+ }
366
216
 
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
- }
217
+ background-color: var(--_bu-badge-bg);
218
+ }
376
219
 
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;
220
+ background: linear-gradient(0deg,
221
+ var(--_bu-bg-gradient-top) 50%,
222
+ var(--_bu-bg-gradient-bottom) 50%
223
+ ) padding-box,
224
+ linear-gradient(0deg,
225
+ var(--_bu-bg-gradient-top) 50%,
226
+ var(--_bu-bg-gradient-bottom) 50%
227
+ ) border-box;
228
+ color: var(--_bu-fc-selected, var(--_bu-fc));
385
229
  }
386
230
 
387
231
  // CHILD ELEMENTS
232
+ // TODO SHINE fine-tune badge styles
388
233
  & &--badge {
389
- opacity: var(--_bu-badge-o);
234
+ background-color: var(--_bu-badge-bg);
235
+ border-radius: var(--br-pill);
390
236
  display: inline-block;
391
- border-radius: var(--br-md);
392
- padding: var(--su2) calc(var(--su4) - var(--su1));
393
237
  font-size: var(--fs-caption);
394
- line-height: var(--lh-xs);
395
- background-color: currentColor;
238
+ line-height: inherit;
239
+ opacity: var(--_bu-badge-o);
240
+ padding: var(--su1) var(--su4) 0;
396
241
  }
397
242
 
398
243
  & &--number {
399
- color: var(--_bu-number-fc);
244
+ color: var(--_bu-badge-fc, var(--_bu-fc));
400
245
  }
401
246
 
247
+ // TODO SHINE do we still need this?
402
248
  &--radio { // This lives alongside a .s-btn element. These styles are the equivelent of `.v-visible-sr`
403
249
  border: 0;
404
250
  clip-path: inset(50%);
251
+ /* stylelint-disable-next-line property-no-deprecated -- clip is kept for older browser compatibility alongside clip-path */
405
252
  clip: rect(var(--su-static1), var(--su-static1), var(--su-static1), var(--su-static1)); // rect(1px, 1px, 1px, 1px)
406
253
  height: var(--su-static1);
407
- margin: calc(var(--su-static1) * -1); // -1px
254
+ margin: var(--sun1);
408
255
  overflow-wrap: normal;
409
256
  overflow: hidden;
410
257
  padding: 0;
@@ -412,93 +259,95 @@
412
259
  width: var(--su-static1);
413
260
  }
414
261
 
262
+ // Sizes
263
+ &&__xs,
264
+ &&__sm {
265
+ --_bu-lh: var(--lh-sm);
266
+ --_bu-px: var(--su12);
267
+ }
268
+ &&__xs {
269
+ --_bu-g: var(--su4);
270
+ --_bu-fs: var(--fs-fine);
271
+ --_bu-py: var(--su6);
272
+ }
273
+ &&__sm {
274
+ --_bu-g: var(--su6);
275
+ --_bu-fs: var(--fs-caption);
276
+ --_bu-py: var(--su8);
277
+ }
278
+ &&__lg {
279
+ --_bu-fs: var(--fs-body2);
280
+ --_bu-px: var(--su24);
281
+ --_bu-py: calc(var(--su12) + var(--su1)); // 13px
282
+ }
283
+
415
284
  // INTERACTION
416
285
  &:not(&__link):not(&__unset):focus-visible,
417
286
  &--radio:focus-visible + & {
418
- .focus-styles(true, true);
287
+ .focus-styles(false, true);
419
288
  }
420
289
 
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
- }
290
+ &:not(.is-selected):hover {
291
+ background:
292
+ linear-gradient(0deg,
293
+ var(--_bu-bg-selected-overlay, var(--_bu-bg-hover, var(--_bu-bg))) 50%,
294
+ var(--_bu-bg-hover, var(--_bu-bg-selected, var(--_bu-bg))) 50%
295
+ ) padding-box,
296
+ linear-gradient(0deg,
297
+ var(--_bu-bg-selected-overlay, var(--_bu-bg-hover, var(--_bu-bg))) 50%,
298
+ var(--_bu-bg-hover, var(--_bu-bg-selected, var(--_bu-bg))) 50%
299
+ ) border-box;
300
+ color: var(--_bu-fc-hover, var(--_bu-fc));
301
+ }
431
302
 
303
+ fieldset[disabled] &,
304
+ &[disabled],
305
+ &[aria-disabled="true"] {
306
+ &,
432
307
  &: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);
308
+ .s-btn--badge {
309
+ .s-btn--number {
310
+ color: var(--_bu-badge-fc-disabled);
454
311
  }
455
- }
456
312
 
457
- background-color: var(--_bu-bg-hover);
458
- color: var(--_bu-fc-hover);
459
- }
460
-
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);
313
+ background-color: var(--_bu-badge-bg-disabled);
466
314
  }
467
315
 
468
- background-color: var(--_bu-bg-active);
469
- border-color: var(--_bu-bc-active);
470
- color: var(--_bu-fc-active);
316
+ background: var(--_bu-bg-disabled, var(--theme-secondary-400));
317
+ border-color: var(--_bu-bc-disabled, var(--_bu-bc, transparent));
318
+ color: var(--_bu-fc-disabled, var(--_bu-fc));
471
319
  }
320
+
321
+ cursor: auto;
472
322
  }
473
323
 
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;
324
+ background:
325
+ linear-gradient(0deg,
326
+ var(--_bu-bg-selected-overlay, var(--_bu-bg)) 50%,
327
+ var(--_bu-bg) 50%
328
+ ) padding-box,
329
+ linear-gradient(0deg,
330
+ var(--_bu-bg-selected-overlay, var(--_bu-bg)) 50%,
331
+ var(--_bu-bg) 50%
332
+ ) border-box;
333
+ border: var(--_bu-baw) solid var(--_bu-bc, transparent);
478
334
  color: var(--_bu-fc);
479
335
  font-size: var(--_bu-fs);
480
- padding: var(--_bu-py, var(--_bu-p)) var(--_bu-px, var(--_bu-p));
336
+ gap: var(--_bu-g);
337
+ padding: var(--_bu-py) var(--_bu-px);
481
338
 
339
+ align-items: center;
340
+ align-self: center;
341
+ border-radius: var(--_bu-br);
342
+ border-style: solid;
482
343
  cursor: pointer;
483
- display: inline-block;
344
+ display: inline-flex;
484
345
  font-family: inherit;
485
- font-weight: normal;
486
- line-height: var(--lh-sm);
346
+ font-weight: 600; // TODO SHINE verify weight
347
+ justify-content: center;
348
+ line-height: var(--_bu-lh);
487
349
  position: relative;
488
- outline: none;
489
350
  text-align: center;
490
351
  text-decoration: none;
491
352
  user-select: none;
492
353
  }
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.