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

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 (60) hide show
  1. package/dist/css/stacks.css +6068 -5972
  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 +11 -10
  19. package/lib/components/bling/bling.less +130 -0
  20. package/lib/components/button/button.less +233 -376
  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 +89 -74
  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 +4 -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/test/visual-test-utils.ts +42 -10
  53. package/lib/tsconfig.json +1 -1
  54. package/package.json +1 -1
  55. package/lib/atomic/width-height.less +0 -194
  56. package/lib/components/award-bling/award-bling.less +0 -32
  57. package/lib/components/check-control/check-control.less +0 -17
  58. package/lib/components/check-group/check-group.less +0 -19
  59. package/lib/components/skeleton/skeleton.less +0 -73
  60. package/lib/exports/spacing-mixins.less +0 -67
@@ -1,151 +1,142 @@
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
9
+ --_bu-badge-fs: var(--fs-caption);
10
+ --_bu-badge-px: var(--su6);
11
+ --_bu-badge-py: var(--su2);
53
12
  --_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
13
 
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
14
+ // VARIANTS
15
+ // Base
16
+ &:not(&__danger):not(&__featured):not(&__tonal):not(&__link):not(&__unset):not(&__facebook):not(&__github):not(&__google) { // Exclude default styles from impacting these variants
17
+ --_bu-bg: var(--theme-button-color, var(--theme-secondary));
18
+ --_bu-bg-disabled: var(--black-350);
19
+ --_bu-bg-hover: var(--theme-button-hover-background-color, var(--theme-secondary-500));
20
+ --_bu-fc: var(--white);
21
+ --_bu-fc-disabled: var(--black-050);
22
+ --_bu-fc-hover: var(--theme-button-hover-color, var(--white));
23
+ --_bu-badge-bg: var(--theme-secondary-500);
24
+ --_bu-badge-fc: var(--white);
25
+ --_bu-badge-bg-disabled: var(--black-250);
26
+ --_bu-badge-fc-disabled: var(--black-050);
27
+
28
+ &.s-btn__clear {
29
+ --_bu-bg: transparent;
30
+ --_bu-bg-disabled: var(--_bu-bg);
31
+ --_bu-bg-hover: var(--theme-secondary-100);
32
+ --_bu-bg-selected: var(--theme-secondary-100);
33
+ --_bu-fc: var(--theme-secondary-600);
34
+ --_bu-fc-disabled: var(--theme-secondary-300);
35
+ --_bu-fc-hover: var(--_bu-fc);
36
+ --_bu-badge-bg: var(--theme-secondary-100);
37
+ --_bu-badge-fc: var(--theme-secondary-500);
38
+ --_bu-badge-bg-disabled: var(--black-100);
39
+ --_bu-badge-fc-disabled: var(--black-350);
40
+
41
+ .highcontrast-mode({
42
+ --_bu-bc: var(--theme-secondary-600);
43
+ });
44
+ }
85
45
  }
86
46
 
87
- &.is-loading {
88
- .svg-icon:first-child {
89
- margin-left: calc((var(--su-static24) - var(--su-static1)) * -1); // -23px
90
- opacity: 0; // [3]
47
+ &&__danger {
48
+ --_bu-bg: var(--red-400);
49
+ --_bu-fc: var(--white);
50
+ --_bu-bg-disabled: var(--red-200);
51
+ --_bu-fc-disabled: var(--black-050);
52
+ --_bu-bg-hover: var(--red-500);
53
+ --_bu-bg-selected: var(--red-500);
54
+ --_bu-fc-selected: var(--_bu-fc);
55
+ --_bu-badge-bg: var(--red-500);
56
+ --_bu-badge-fc: var(--black-050);
57
+ --_bu-badge-bg-disabled: var(--red-300);
58
+ --_bu-badge-fc-disabled: var(--black-100);
59
+
60
+ &.s-btn__clear {
61
+ --_bu-bg: transparent;
62
+ --_bu-bg-disabled: var(--_bu-bg);
63
+ --_bu-bg-hover: var(--red-100);
64
+ --_bu-bg-selected: var(--red-100);
65
+ --_bu-fc: var(--red-400);
66
+ --_bu-fc-disabled: var(--red-200);
67
+ --_bu-fc-hover: var(--red-500);
68
+ --_bu-fc-selected: var(--red-500);
69
+ --_bu-badge-bg: var(--red-100);
70
+ --_bu-badge-fc: var(--red-500);
71
+ --_bu-badge-bg-disabled: var(--red-100);
72
+ --_bu-badge-fc-disabled: var(--red-300);
73
+
74
+ .highcontrast-mode({
75
+ --_bu-bc: var(--red-600);
76
+ --_bu-bc-disabled: var(--red-300);
77
+ });
91
78
  }
92
-
93
- padding-left: 2.2em;
94
79
  }
95
80
 
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);
81
+ &&__featured {
82
+ --_bu-bg: var(--purple-400);
83
+ --_bu-bg-disabled: var(--purple-200);
84
+ --_bu-bg-hover: var(--purple-500);
85
+ --_bu-bg-selected: var(--purple-500);
86
+ --_bu-fc: var(--white);
87
+ --_bu-fc-selected: var(--_bu-fc);
88
+ --_bu-badge-bg: var(--purple-500);
89
+ --_bu-badge-fc: var(--black-050);
90
+ --_bu-badge-bg-disabled: var(--purple-300);
91
+ --_bu-badge-fc-disabled: var(--black-100);
92
+ }
101
93
 
102
- .s-btn--number {
103
- color: var(--_bu-number-fc-selected);
104
- }
94
+ &&__tonal {
95
+ --_bu-bg: var(--black-150);
96
+ --_bu-bg-disabled: var(--black-100);
97
+ --_bu-bg-hover: var(--black-200);
98
+ --_bu-fc: var(--black);
99
+ --_bu-fc-disabled: var(--black-300);
100
+ --_bu-fc-selected: var(--_bu-fc);
101
+ --_bu-badge-bg: var(--black-200);
102
+ --_bu-badge-fc: var(--black-600);
103
+ --_bu-badge-bg-disabled: var(--black-100);
104
+ --_bu-badge-fc-disabled: var(--black-350);
105
105
 
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
- }
106
+ .highcontrast-mode({
107
+ --_bu-bc: var(--black-300);
108
+ });
125
109
  }
126
110
 
127
- // MODIFIERS
128
- &&__filled {
129
- .s-btn--number {
130
- color: var(--_bu-number-fc-filled);
131
- }
111
+ // Social
112
+ &&__facebook {
113
+ @_fb-brand: #1877F2;
114
+ --_bu-bg: @_fb-brand;
115
+ --_bu-bg-hover: darken(@_fb-brand, 5%);
116
+ --_bu-fc: #fff;
117
+ --_bu-fc-hover: var(--_bu-fc);
118
+ }
132
119
 
133
- border-color: var(--_bu-filled-bc);
134
- background-color: var(--_bu-filled-bg);
135
- color: var(--_bu-filled-fc);
120
+ &&__google {
121
+ --_bu-bg: var(--black-150);
122
+ --_bu-bg-hover: var(--black-200);
123
+ --_bu-fc: var(--black-600);
136
124
  }
137
125
 
138
- &&__outlined {
139
- border-color: var(--_bu-outlined-bc);
140
- background-color: var(--_bu-outlined-bg, inherit);
126
+ &&__github {
127
+ --_bu-bg: var(--black-600);
128
+ --_bu-bg-hover: var(--black-500);
129
+ --_bu-fc: var(--white);
141
130
  }
142
131
 
132
+ // MODIFIERS
143
133
  // Resets
144
134
  &&__link,
145
135
  &&__unset {
146
136
  --_bu-baw: 0;
147
137
  --_bu-br: 0;
148
- --_bu-p: 0;
138
+ --_bu-px: 0;
139
+ --_bu-py: 0;
149
140
 
150
141
  &:focus,
151
142
  &:focus-visible {
@@ -179,8 +170,13 @@
179
170
  &:hover,
180
171
  &:active,
181
172
  &:focus {
173
+ --_bu-baw: 0;
182
174
  --_bu-bg: none;
175
+ --_bu-br: unset;
183
176
  --_bu-fc: unset;
177
+ --_bu-fs: inherit;
178
+ --_bu-g: unset;
179
+ --_bu-lh: inherit;
184
180
 
185
181
  cursor: default;
186
182
  font: unset;
@@ -190,7 +186,6 @@
190
186
  outline: initial;
191
187
  }
192
188
 
193
- // Pseudo-elements and child-based modifiers
194
189
  &&__dropdown {
195
190
  &:after {
196
191
  border-color: currentColor transparent;
@@ -198,213 +193,69 @@
198
193
  border-width: var(--_bu-dropdown-bw);
199
194
  border-bottom-width: 0;
200
195
  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
196
  }
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
197
  }
270
198
 
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;
199
+ &.is-selected,
200
+ .s-btn--radio:checked + & {
201
+ --_bu-bg-selected-overlay-o: 20%;
202
+ --_bu-bg-selected-overlay: color-mix(
203
+ in srgb,
204
+ var(--_bu-bg-selected, var(--_bu-bg)),
205
+ var(--white) var(--_bu-bg-selected-overlay-o)
206
+ );
207
+ --_bu-bg-gradient-top: var(--_bu-bg-selected, var(--_bu-bg));
208
+ --_bu-bg-gradient-bottom: var(--_bu-bg-selected-overlay, var(--_bu-bg));
209
+
210
+ .dark-mode({
211
+ --_bu-bg-selected-overlay-o: 13%;
212
+ --_bu-bg-gradient-top: var(--_bu-bg-selected-overlay, var(--_bu-bg));
213
+ --_bu-bg-gradient-bottom: var(--_bu-bg-selected, var(--_bu-bg));
352
214
  });
353
- }
354
215
 
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
- }
216
+ .s-btn--badge {
217
+ .s-btn--number {
218
+ color: var(--_bu-badge-fc, var(--_bu-fc));
219
+ }
366
220
 
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
- }
221
+ background-color: var(--_bu-badge-bg);
222
+ }
376
223
 
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;
224
+ background: linear-gradient(0deg,
225
+ var(--_bu-bg-gradient-top) 50%,
226
+ var(--_bu-bg-gradient-bottom) 50%
227
+ ) padding-box,
228
+ linear-gradient(0deg,
229
+ var(--_bu-bg-gradient-top) 50%,
230
+ var(--_bu-bg-gradient-bottom) 50%
231
+ ) border-box;
232
+ color: var(--_bu-fc-selected, var(--_bu-fc));
385
233
  }
386
234
 
387
235
  // CHILD ELEMENTS
388
236
  & &--badge {
389
- opacity: var(--_bu-badge-o);
237
+ background-color: var(--_bu-badge-bg);
238
+ border-radius: var(--br-pill);
390
239
  display: inline-block;
391
- border-radius: var(--br-md);
392
- padding: var(--su2) calc(var(--su4) - var(--su1));
393
- font-size: var(--fs-caption);
394
- line-height: var(--lh-xs);
395
- background-color: currentColor;
240
+ font-size: var(--_bu-badge-fs);
241
+ line-height: inherit;
242
+ opacity: var(--_bu-badge-o);
243
+ padding: var(--_bu-badge-py) var(--_bu-badge-px);
244
+ margin-block: calc(var(--_bu-badge-py) * -1);
396
245
  }
397
246
 
398
247
  & &--number {
399
- color: var(--_bu-number-fc);
248
+ color: var(--_bu-badge-fc, var(--_bu-fc));
400
249
  }
401
250
 
251
+ // TODO SHINE do we still need this?
402
252
  &--radio { // This lives alongside a .s-btn element. These styles are the equivelent of `.v-visible-sr`
403
253
  border: 0;
404
254
  clip-path: inset(50%);
255
+ /* stylelint-disable-next-line property-no-deprecated -- clip is kept for older browser compatibility alongside clip-path */
405
256
  clip: rect(var(--su-static1), var(--su-static1), var(--su-static1), var(--su-static1)); // rect(1px, 1px, 1px, 1px)
406
257
  height: var(--su-static1);
407
- margin: calc(var(--su-static1) * -1); // -1px
258
+ margin: var(--sun1);
408
259
  overflow-wrap: normal;
409
260
  overflow: hidden;
410
261
  padding: 0;
@@ -412,93 +263,99 @@
412
263
  width: var(--su-static1);
413
264
  }
414
265
 
266
+ // Sizes
267
+ &&__xs,
268
+ &&__sm {
269
+ --_bu-lh: var(--lh-sm);
270
+ --_bu-px: var(--su12);
271
+ --_bu-badge-fs: var(--fs-fine);
272
+ --_bu-badge-py: var(--su1);
273
+ --_bu-badge-px: calc(var(--su2) + var(--su1)); // 3px
274
+ }
275
+ &&__xs {
276
+ --_bu-g: var(--su4);
277
+ --_bu-fs: var(--fs-fine);
278
+ --_bu-py: var(--su6);
279
+ }
280
+ &&__sm {
281
+ --_bu-g: var(--su6);
282
+ --_bu-fs: var(--fs-caption);
283
+ --_bu-py: var(--su8);
284
+ }
285
+ &&__lg {
286
+ --_bu-fs: var(--fs-body2);
287
+ --_bu-px: var(--su24);
288
+ --_bu-py: calc(var(--su12) + var(--su1)); // 13px
289
+ --_bu-badge-py: calc(var(--su2) + var(--su1)); // 3px
290
+ }
291
+
415
292
  // INTERACTION
416
293
  &:not(&__link):not(&__unset):focus-visible,
417
294
  &--radio:focus-visible + & {
418
- .focus-styles(true, true);
295
+ .focus-styles(false, true);
419
296
  }
420
297
 
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
- }
298
+ &:not(.is-selected):hover {
299
+ background:
300
+ linear-gradient(0deg,
301
+ var(--_bu-bg-selected-overlay, var(--_bu-bg-hover, var(--_bu-bg))) 50%,
302
+ var(--_bu-bg-hover, var(--_bu-bg-selected, var(--_bu-bg))) 50%
303
+ ) padding-box,
304
+ linear-gradient(0deg,
305
+ var(--_bu-bg-selected-overlay, var(--_bu-bg-hover, var(--_bu-bg))) 50%,
306
+ var(--_bu-bg-hover, var(--_bu-bg-selected, var(--_bu-bg))) 50%
307
+ ) border-box;
308
+ color: var(--_bu-fc-hover, var(--_bu-fc));
309
+ }
431
310
 
311
+ fieldset[disabled] &,
312
+ &[disabled],
313
+ &[aria-disabled="true"] {
314
+ &,
432
315
  &: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);
316
+ .s-btn--badge {
317
+ .s-btn--number {
318
+ color: var(--_bu-badge-fc-disabled);
454
319
  }
455
- }
456
320
 
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);
321
+ background-color: var(--_bu-badge-bg-disabled);
466
322
  }
467
323
 
468
- background-color: var(--_bu-bg-active);
469
- border-color: var(--_bu-bc-active);
470
- color: var(--_bu-fc-active);
324
+ background: var(--_bu-bg-disabled, var(--theme-secondary-400));
325
+ border-color: var(--_bu-bc-disabled, var(--_bu-bc, transparent));
326
+ color: var(--_bu-fc-disabled, var(--_bu-fc));
471
327
  }
328
+
329
+ cursor: auto;
472
330
  }
473
331
 
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;
332
+ background:
333
+ linear-gradient(0deg,
334
+ var(--_bu-bg-selected-overlay, var(--_bu-bg)) 50%,
335
+ var(--_bu-bg) 50%
336
+ ) padding-box,
337
+ linear-gradient(0deg,
338
+ var(--_bu-bg-selected-overlay, var(--_bu-bg)) 50%,
339
+ var(--_bu-bg) 50%
340
+ ) border-box;
341
+ border: var(--_bu-baw) solid var(--_bu-bc, transparent);
478
342
  color: var(--_bu-fc);
479
343
  font-size: var(--_bu-fs);
480
- padding: var(--_bu-py, var(--_bu-p)) var(--_bu-px, var(--_bu-p));
344
+ gap: var(--_bu-g);
345
+ padding: var(--_bu-py) var(--_bu-px);
481
346
 
347
+ align-items: center;
348
+ align-self: center;
349
+ border-radius: var(--_bu-br);
350
+ border-style: solid;
482
351
  cursor: pointer;
483
- display: inline-block;
352
+ display: inline-flex;
484
353
  font-family: inherit;
485
- font-weight: normal;
486
- line-height: var(--lh-sm);
354
+ font-weight: 600; // TODO SHINE verify weight
355
+ justify-content: center;
356
+ line-height: var(--_bu-lh);
487
357
  position: relative;
488
- outline: none;
489
358
  text-align: center;
490
359
  text-decoration: none;
491
360
  user-select: none;
492
361
  }
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.