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

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 (108) hide show
  1. package/dist/controllers.d.ts +0 -2
  2. package/dist/css/stacks.css +14245 -15086
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +0 -364
  5. package/dist/js/stacks.min.js +1 -1
  6. package/lib/atomic/backgrounds.less +67 -0
  7. package/lib/atomic/border-radius.less +38 -0
  8. package/lib/atomic/borders.less +73 -0
  9. package/lib/atomic/box-shadow.less +29 -0
  10. package/lib/atomic/box-sizing.less +3 -0
  11. package/lib/atomic/current-color.less +2 -0
  12. package/lib/atomic/cursors.less +8 -0
  13. package/lib/atomic/display.less +15 -0
  14. package/lib/atomic/flex.less +6 -34
  15. package/lib/atomic/floats.less +20 -0
  16. package/lib/atomic/gap.less +2 -0
  17. package/lib/atomic/grid.less +2 -0
  18. package/lib/atomic/height.less +22 -0
  19. package/lib/atomic/interactivity.less +45 -0
  20. package/lib/atomic/lists.less +29 -0
  21. package/lib/atomic/margin.less +48 -0
  22. package/lib/atomic/object-fit.less +9 -0
  23. package/lib/atomic/opacity.less +54 -0
  24. package/lib/atomic/outline.less +11 -0
  25. package/lib/atomic/overflow.less +17 -0
  26. package/lib/atomic/padding.less +12 -0
  27. package/lib/atomic/positioning.less +41 -0
  28. package/lib/atomic/sizing.less +51 -0
  29. package/lib/atomic/transitions.less +20 -0
  30. package/lib/atomic/truncation.less +58 -0
  31. package/lib/atomic/typography.less +71 -137
  32. package/lib/atomic/vertical-alignment.less +9 -0
  33. package/lib/atomic/visibility.less +18 -0
  34. package/lib/atomic/width.less +27 -0
  35. package/lib/atomic/z-index.less +12 -0
  36. package/lib/base/body.less +2 -4
  37. package/lib/base/configuration-static.less +3 -3
  38. package/lib/base/internal.less +3 -5
  39. package/lib/base/reset-normalize.less +3 -3
  40. package/lib/components/activity-indicator/activity-indicator.less +4 -20
  41. package/lib/components/anchor/anchor.less +28 -39
  42. package/lib/components/avatar/avatar.less +20 -19
  43. package/lib/components/badge/badge.less +227 -167
  44. package/lib/components/banner/banner.less +12 -11
  45. package/lib/components/bling/bling.less +47 -10
  46. package/lib/components/button/button.less +300 -380
  47. package/lib/components/checkbox_radio/checkbox_radio.less +195 -113
  48. package/lib/components/code-block/code-block.fixtures.ts +2 -2
  49. package/lib/components/code-block/code-block.less +2 -3
  50. package/lib/components/description/description.less +17 -2
  51. package/lib/components/empty-state/empty-state.less +17 -6
  52. package/lib/components/form-group/form-group.less +38 -0
  53. package/lib/components/input-fill/input-fill.less +3 -3
  54. package/lib/components/input-icon/input-icon.less +3 -3
  55. package/lib/components/input-message/input-message.less +1 -0
  56. package/lib/components/input_textarea/input_textarea.less +71 -58
  57. package/lib/components/label/label.less +12 -56
  58. package/lib/components/link/link.less +44 -98
  59. package/lib/components/loader/loader.less +88 -0
  60. package/lib/components/menu/menu.less +89 -19
  61. package/lib/components/modal/modal.less +10 -10
  62. package/lib/components/navigation/navigation.less +77 -42
  63. package/lib/components/notice/notice.less +90 -75
  64. package/lib/components/pagination/pagination.less +50 -42
  65. package/lib/components/popover/popover.less +9 -11
  66. package/lib/components/post-summary/post-summary.less +225 -385
  67. package/lib/components/prose/prose.less +49 -35
  68. package/lib/components/select/select.less +46 -41
  69. package/lib/components/sidebar-widget/sidebar-widget.less +26 -196
  70. package/lib/components/table/table.less +48 -22
  71. package/lib/components/tag/tag.less +25 -6
  72. package/lib/components/toast/toast.less +4 -2
  73. package/lib/components/toggle-switch/toggle-switch.less +15 -19
  74. package/lib/components/user-card/user-card.less +129 -92
  75. package/lib/components/vote/vote.less +134 -0
  76. package/lib/controllers.ts +0 -2
  77. package/lib/exports/color-sets.less +108 -81
  78. package/lib/exports/constants-helpers.less +9 -13
  79. package/lib/exports/constants-type.less +18 -36
  80. package/lib/exports/mixins.less +92 -272
  81. package/lib/index.ts +0 -4
  82. package/lib/stacks-static.less +44 -30
  83. package/lib/test/visual-test-utils.ts +42 -10
  84. package/lib/tsconfig.json +1 -1
  85. package/package.json +1 -1
  86. package/dist/components/expandable/expandable.d.ts +0 -17
  87. package/dist/components/uploader/uploader.d.ts +0 -48
  88. package/lib/atomic/border.less +0 -121
  89. package/lib/atomic/misc.less +0 -374
  90. package/lib/atomic/spacing.less +0 -98
  91. package/lib/atomic/width-height.less +0 -194
  92. package/lib/components/block-link/block-link.less +0 -82
  93. package/lib/components/breadcrumbs/breadcrumbs.less +0 -41
  94. package/lib/components/button-group/button-group.less +0 -81
  95. package/lib/components/card/card.less +0 -37
  96. package/lib/components/check-control/check-control.less +0 -17
  97. package/lib/components/check-group/check-group.less +0 -19
  98. package/lib/components/expandable/expandable.less +0 -119
  99. package/lib/components/expandable/expandable.ts +0 -238
  100. package/lib/components/link-preview/link-preview.less +0 -148
  101. package/lib/components/page-title/page-title.less +0 -51
  102. package/lib/components/progress-bar/progress-bar.less +0 -292
  103. package/lib/components/skeleton/skeleton.less +0 -73
  104. package/lib/components/spinner/spinner.less +0 -103
  105. package/lib/components/topbar/topbar.less +0 -553
  106. package/lib/components/uploader/uploader.less +0 -205
  107. package/lib/components/uploader/uploader.ts +0 -207
  108. package/lib/exports/spacing-mixins.less +0 -67
@@ -1,151 +1,204 @@
1
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));
2
+ --_bu-baw: var(--su1);
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;
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-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
- }
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);
12
+ --_bu-dropdown-bw: var(--su4);
76
13
 
77
- button &,
78
- button[type="submit"] &,
79
- button[type="reset"] & {
80
- -webkit-appearance: button; // [2]
81
- }
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(--theme-secondary-300);
19
+ --_bu-bg-hover: var(--theme-button-hover-background-color, var(--theme-secondary-500));
20
+ --_bu-fc: var(--white);
21
+ --_bu-fc-disabled: var(--theme-secondary-100);
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(--theme-secondary-300);
26
+ --_bu-badge-fc-disabled: var(--theme-secondary-100);
82
27
 
83
- &.grid {
84
- display: flex; // Override &&__danger buttons having inline-block by default
85
- }
28
+ .highcontrast-mode({
29
+ --_bu-bg-disabled: var(--theme-secondary-300);
30
+ });
86
31
 
87
- &.is-loading {
88
- .svg-icon:first-child {
89
- margin-left: calc((var(--su-static24) - var(--su-static1)) * -1); // -23px
90
- opacity: 0; // [3]
32
+ &.s-btn__clear {
33
+ --_bu-bg: transparent;
34
+ --_bu-bg-disabled: var(--_bu-bg);
35
+ --_bu-bg-hover: var(--theme-secondary-100);
36
+ --_bu-bg-selected: var(--theme-secondary-100);
37
+ --_bu-fc: var(--theme-secondary-600);
38
+ --_bu-fc-disabled: var(--theme-secondary-300);
39
+ --_bu-fc-hover: var(--_bu-fc);
40
+ --_bu-badge-bg: var(--theme-secondary-100);
41
+ --_bu-badge-fc: var(--theme-secondary-500);
42
+ --_bu-badge-bg-disabled: var(--theme-secondary-100);
43
+ --_bu-badge-fc-disabled: var(--theme-secondary-300);
44
+
45
+ .highcontrast-mode({
46
+ --_bu-bc: var(--theme-secondary-400);
47
+ --_bu-bc-disabled: var(--theme-secondary-300);
48
+ --_bu-bg-disabled: var(--white);
49
+ --_bu-badge-bg-disabled: var(--theme-secondary-100);
50
+ --_bu-badge-fc-disabled: var(--theme-secondary-300);
51
+ });
91
52
  }
92
-
93
- padding-left: 2.2em;
94
53
  }
95
54
 
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);
55
+ &&__danger {
56
+ --_bu-bg: var(--red-400);
57
+ --_bu-fc: var(--white);
58
+ --_bu-bg-disabled: var(--red-200);
59
+ --_bu-fc-disabled: var(--black-050);
60
+ --_bu-bg-hover: var(--red-500);
61
+ --_bu-bg-selected: var(--red-500);
62
+ --_bu-fc-selected: var(--_bu-fc);
63
+ --_bu-badge-bg: var(--red-500);
64
+ --_bu-badge-fc: var(--black-050);
65
+ --_bu-badge-bg-disabled: var(--red-300);
66
+ --_bu-badge-fc-disabled: var(--black-100);
67
+
68
+ .dark-mode({
69
+ --_bu-bg-disabled: var(--red-300);
70
+ --_bu-badge-fc-disabled: var(--black-050);
71
+ --_bu-badge-bg-disabled: var(--red-400);
72
+ });
101
73
 
102
- .s-btn--number {
103
- color: var(--_bu-number-fc-selected);
104
- }
74
+ .highcontrast-mode({
75
+ --_bu-fc-disabled: var(--black-300);
76
+ --_bu-badge-bg-disabled: var(--red-100);
77
+ --_bu-badge-fc-disabled: var(--black-300);
78
+ });
105
79
 
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
- }
80
+ .highcontrast-dark-mode({
81
+ --_bu-bg-disabled: var(--red-300);
82
+ --_bu-fc-disabled: var(--black-050);
83
+ --_bu-badge-fc-disabled: var(--black-050);
84
+ --_bu-badge-bg-disabled: var(--red-400);
85
+ });
86
+
87
+ &.s-btn__clear {
88
+ --_bu-bg: transparent;
89
+ --_bu-bg-disabled: var(--_bu-bg);
90
+ --_bu-bg-hover: var(--red-100);
91
+ --_bu-bg-selected: var(--red-100);
92
+ --_bu-fc: var(--red-400);
93
+ --_bu-fc-disabled: var(--red-200);
94
+ --_bu-fc-hover: var(--red-500);
95
+ --_bu-fc-selected: var(--red-500);
96
+ --_bu-badge-bg: var(--red-100);
97
+ --_bu-badge-fc: var(--red-500);
98
+ --_bu-badge-bg-disabled: var(--red-100);
99
+ --_bu-badge-fc-disabled: var(--red-300);
100
+
101
+ .dark-mode({
102
+ --_bu-bg-disabled: var(--_bu-bg);
103
+ --_bu-fc-disabled: var(--red-300);
104
+ --_bu-badge-bg-disabled: var(--red-100);
105
+ --_bu-badge-fc-disabled: var(--red-400);
106
+ });
107
+
108
+ .highcontrast-mode({
109
+ --_bu-bc: var(--red-600);
110
+ --_bu-bc-disabled: var(--black-300);
111
+ });
112
+
113
+ .highcontrast-dark-mode({
114
+ --_bu-bg-disabled: var(--black-050);
115
+ --_bu-fc-disabled: var(--red-300);
116
+ --_bu-badge-bg-disabled: var(--red-100);
117
+ --_bu-badge-fc-disabled: var(--red-300);
118
+ });
124
119
  }
125
120
  }
126
121
 
127
- // MODIFIERS
128
- &&__filled {
129
- .s-btn--number {
130
- color: var(--_bu-number-fc-filled);
131
- }
122
+ &&__featured {
123
+ --_bu-bg: var(--purple-400);
124
+ --_bu-bg-disabled: var(--purple-200);
125
+ --_bu-bg-hover: var(--purple-500);
126
+ --_bu-bg-selected: var(--purple-500);
127
+ --_bu-fc: var(--white);
128
+ --_bu-fc-selected: var(--_bu-fc);
129
+ --_bu-badge-bg: var(--purple-500);
130
+ --_bu-badge-fc: var(--black-050);
131
+ --_bu-badge-bg-disabled: var(--purple-300);
132
+ --_bu-badge-fc-disabled: var(--black-100);
133
+
134
+ .dark-mode({
135
+ --_bu-bg-disabled: var(--purple-100);
136
+ --_bu-fc-disabled: var(--purple-400);
137
+ --_bu-badge-fc-disabled: var(--purple-400);
138
+ --_bu-badge-bg-disabled: var(--purple-200);
139
+ });
140
+
141
+ .highcontrast-mode({
142
+ --_bu-fc-disabled: var(--black-300);
143
+ --_bu-badge-fc-disabled: var(--black-300);
144
+ --_bu-badge-bg-disabled: var(--purple-200);
145
+ });
146
+
147
+ .highcontrast-dark-mode({
148
+ --_bu-fc-disabled: var(--purple-400);
149
+ --_bu-badge-bg-disabled: var(--purple-200);
150
+ --_bu-badge-fc-disabled: var(--purple-400);
151
+ });
152
+ }
153
+
154
+ &&__tonal {
155
+ --_bu-bg: var(--black-150);
156
+ --_bu-bg-disabled: var(--black-100);
157
+ --_bu-bg-hover: var(--black-200);
158
+ --_bu-bg-selected: var(--black-200);
159
+ --_bu-fc: var(--black);
160
+ --_bu-fc-disabled: var(--black-300);
161
+ --_bu-fc-selected: var(--_bu-fc);
162
+ --_bu-badge-bg: var(--black-200);
163
+ --_bu-badge-fc: var(--black-600);
164
+ --_bu-badge-bg-disabled: var(--black-100);
165
+ --_bu-badge-fc-disabled: var(--black-300);
166
+
167
+ .highcontrast-mode({
168
+ --_bu-bc: var(--black-400);
169
+ --_bu-bc-disabled: var(--black-300);
170
+ });
171
+ }
172
+
173
+ // Social
174
+ &&__facebook {
175
+ @_fb-brand: #1877F2;
176
+ --_bu-bg: @_fb-brand;
177
+ --_bu-bg-hover: darken(@_fb-brand, 5%);
178
+ --_bu-fc: #fff;
179
+ --_bu-fc-hover: var(--_bu-fc);
180
+ }
132
181
 
133
- border-color: var(--_bu-filled-bc);
134
- background-color: var(--_bu-filled-bg);
135
- color: var(--_bu-filled-fc);
182
+ &&__google {
183
+ --_bu-bg: var(--black-150);
184
+ --_bu-bg-hover: var(--black-200);
185
+ --_bu-fc: var(--black-600);
136
186
  }
137
187
 
138
- &&__outlined {
139
- border-color: var(--_bu-outlined-bc);
140
- background-color: var(--_bu-outlined-bg, inherit);
188
+ &&__github {
189
+ --_bu-bg: var(--black-600);
190
+ --_bu-bg-hover: var(--black-500);
191
+ --_bu-fc: var(--white);
141
192
  }
142
193
 
194
+ // MODIFIERS
143
195
  // Resets
144
196
  &&__link,
145
197
  &&__unset {
146
198
  --_bu-baw: 0;
147
199
  --_bu-br: 0;
148
- --_bu-p: 0;
200
+ --_bu-px: 0;
201
+ --_bu-py: 0;
149
202
 
150
203
  &:focus,
151
204
  &:focus-visible {
@@ -179,8 +232,13 @@
179
232
  &:hover,
180
233
  &:active,
181
234
  &:focus {
235
+ --_bu-baw: 0;
182
236
  --_bu-bg: none;
237
+ --_bu-br: unset;
183
238
  --_bu-fc: unset;
239
+ --_bu-fs: inherit;
240
+ --_bu-g: unset;
241
+ --_bu-lh: inherit;
184
242
 
185
243
  cursor: default;
186
244
  font: unset;
@@ -190,7 +248,6 @@
190
248
  outline: initial;
191
249
  }
192
250
 
193
- // Pseudo-elements and child-based modifiers
194
251
  &&__dropdown {
195
252
  &:after {
196
253
  border-color: currentColor transparent;
@@ -198,307 +255,170 @@
198
255
  border-width: var(--_bu-dropdown-bw);
199
256
  border-bottom-width: 0;
200
257
  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
- }
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
258
  }
218
259
  }
219
260
 
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
- }
346
-
347
- // Social
348
- &&__facebook,
349
- &&__github {
350
- .highcontrast-mode({
351
- --_bu-bc: transparent;
261
+ &.is-selected,
262
+ .s-btn--radio:checked + & {
263
+ --_bu-bg-selected-overlay-o: 20%;
264
+ --_bu-bg-selected-overlay: color-mix(
265
+ in srgb,
266
+ var(--_bu-bg-selected, var(--_bu-bg)),
267
+ var(--white) var(--_bu-bg-selected-overlay-o)
268
+ );
269
+ --_bu-bg-gradient-top: var(--_bu-bg-selected-overlay, var(--_bu-bg));
270
+ --_bu-bg-gradient-bottom: var(--_bu-bg-selected, var(--_bu-bg));
271
+
272
+
273
+ .dark-mode({
274
+ --_bu-bg-selected-overlay-o: 13%;
275
+ --_bu-bg-gradient-top: var(--_bu-bg-selected-overlay, var(--_bu-bg));
276
+ --_bu-bg-gradient-bottom: var(--_bu-bg-selected, var(--_bu-bg));
352
277
  });
353
- }
354
278
 
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
- }
279
+ .s-btn--badge {
280
+ .s-btn--number {
281
+ color: var(--_bu-badge-fc, var(--_bu-fc));
282
+ }
366
283
 
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
- }
284
+ background-color: var(--_bu-badge-bg);
285
+ }
376
286
 
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;
287
+ background: linear-gradient(0deg,
288
+ var(--_bu-bg-gradient-top) 50%,
289
+ var(--_bu-bg-gradient-bottom) 50%
290
+ ) padding-box,
291
+ linear-gradient(0deg,
292
+ var(--_bu-bg-gradient-top) 50%,
293
+ var(--_bu-bg-gradient-bottom) 50%
294
+ ) border-box;
295
+ color: var(--_bu-fc-selected, var(--_bu-fc));
385
296
  }
386
297
 
387
298
  // CHILD ELEMENTS
388
299
  & &--badge {
389
- opacity: var(--_bu-badge-o);
300
+ background-color: var(--_bu-badge-bg);
301
+ border-radius: var(--br-pill);
390
302
  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;
303
+ font-size: var(--_bu-badge-fs);
304
+ line-height: inherit;
305
+ opacity: var(--_bu-badge-o);
306
+ padding: var(--_bu-badge-py) var(--_bu-badge-px);
307
+ margin-block: calc(var(--_bu-badge-py) * -1);
396
308
  }
397
309
 
398
310
  & &--number {
399
- color: var(--_bu-number-fc);
311
+ color: var(--_bu-badge-fc, var(--_bu-fc));
400
312
  }
401
313
 
314
+ // TODO SHINE do we still need this?
402
315
  &--radio { // This lives alongside a .s-btn element. These styles are the equivelent of `.v-visible-sr`
403
316
  border: 0;
404
317
  clip-path: inset(50%);
405
- clip: rect(var(--su-static1), var(--su-static1), var(--su-static1), var(--su-static1)); // rect(1px, 1px, 1px, 1px)
406
- height: var(--su-static1);
407
- margin: calc(var(--su-static1) * -1); // -1px
318
+ /* stylelint-disable-next-line property-no-deprecated -- clip is kept for older browser compatibility alongside clip-path */
319
+ clip: rect(var(--su1), var(--su1), var(--su1), var(--su1)); // rect(1px, 1px, 1px, 1px)
320
+ height: var(--su1);
321
+ margin: var(--sun1);
408
322
  overflow-wrap: normal;
409
323
  overflow: hidden;
410
324
  padding: 0;
411
325
  position: absolute;
412
- width: var(--su-static1);
326
+ width: var(--su1);
327
+ }
328
+
329
+ // Sizes
330
+ &&__xs,
331
+ &&__sm {
332
+ --_bu-lh: var(--lh-sm);
333
+ --_bu-px: var(--su12);
334
+ --_bu-badge-fs: var(--fs-fine);
335
+ --_bu-badge-py: var(--su1);
336
+ --_bu-badge-px: var(--su3);
337
+ }
338
+ &&__xs {
339
+ --_bu-g: var(--su4);
340
+ --_bu-fs: var(--fs-fine);
341
+ --_bu-py: var(--su6);
342
+ }
343
+ &&__sm {
344
+ --_bu-g: var(--su6);
345
+ --_bu-fs: var(--fs-caption);
346
+ --_bu-py: var(--su8);
347
+ }
348
+ &&__lg {
349
+ --_bu-fs: var(--fs-body2);
350
+ --_bu-px: var(--su24);
351
+ --_bu-py: calc(var(--su12) + var(--su1)); // 13px
352
+ --_bu-badge-py: var(--su3); // 3px
413
353
  }
414
354
 
415
355
  // INTERACTION
416
356
  &:not(&__link):not(&__unset):focus-visible,
417
357
  &--radio:focus-visible + & {
418
- .focus-styles(true, true);
358
+ .focus-styles(false, true);
419
359
  }
420
360
 
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
- }
361
+ &:not(.is-selected):hover {
362
+ background:
363
+ linear-gradient(0deg,
364
+ var(--_bu-bg-selected-overlay, var(--_bu-bg-hover, var(--_bu-bg))) 50%,
365
+ var(--_bu-bg-hover, var(--_bu-bg-selected, var(--_bu-bg))) 50%
366
+ ) padding-box,
367
+ linear-gradient(0deg,
368
+ var(--_bu-bg-selected-overlay, var(--_bu-bg-hover, var(--_bu-bg))) 50%,
369
+ var(--_bu-bg-hover, var(--_bu-bg-selected, var(--_bu-bg))) 50%
370
+ ) border-box;
371
+ color: var(--_bu-fc-hover, var(--_bu-fc));
372
+ }
431
373
 
374
+ fieldset[disabled] &,
375
+ &[disabled],
376
+ &[aria-disabled="true"] {
377
+ &,
432
378
  &: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);
379
+ .s-btn--badge {
380
+ .s-btn--number {
381
+ color: var(--_bu-badge-fc-disabled);
454
382
  }
455
- }
456
-
457
- background-color: var(--_bu-bg-hover);
458
- color: var(--_bu-fc-hover);
459
- }
460
383
 
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);
384
+ background-color: var(--_bu-badge-bg-disabled);
466
385
  }
467
386
 
468
- background-color: var(--_bu-bg-active);
469
- border-color: var(--_bu-bc-active);
470
- color: var(--_bu-fc-active);
387
+ background: var(--_bu-bg-disabled, var(--theme-secondary-400));
388
+ border-color: var(--_bu-bc-disabled, var(--_bu-bc, transparent));
389
+ color: var(--_bu-fc-disabled, var(--_bu-fc));
471
390
  }
391
+
392
+ cursor: auto;
472
393
  }
473
394
 
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;
395
+ background:
396
+ linear-gradient(0deg,
397
+ var(--_bu-bg-selected-overlay, var(--_bu-bg)) 50%,
398
+ var(--_bu-bg) 50%
399
+ ) padding-box,
400
+ linear-gradient(0deg,
401
+ var(--_bu-bg-selected-overlay, var(--_bu-bg)) 50%,
402
+ var(--_bu-bg) 50%
403
+ ) border-box;
404
+ border: var(--_bu-baw) solid var(--_bu-bc, transparent);
478
405
  color: var(--_bu-fc);
479
406
  font-size: var(--_bu-fs);
480
- padding: var(--_bu-py, var(--_bu-p)) var(--_bu-px, var(--_bu-p));
407
+ gap: var(--_bu-g);
408
+ padding: var(--_bu-py) var(--_bu-px);
481
409
 
410
+ align-items: center;
411
+ align-self: center;
412
+ border-radius: var(--_bu-br);
413
+ border-style: solid;
482
414
  cursor: pointer;
483
- display: inline-block;
415
+ display: inline-flex;
484
416
  font-family: inherit;
485
- font-weight: normal;
486
- line-height: var(--lh-sm);
417
+ font-weight: 600; // TODO SHINE verify weight
418
+ justify-content: center;
419
+ line-height: var(--_bu-lh);
487
420
  position: relative;
488
- outline: none;
489
421
  text-align: center;
490
422
  text-decoration: none;
491
423
  user-select: none;
492
424
  }
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.