@stackoverflow/stacks 0.74.0 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/controllers/index.d.ts +7 -0
  2. package/dist/controllers/s-expandable-control.d.ts +17 -0
  3. package/dist/controllers/s-modal.d.ts +97 -0
  4. package/dist/controllers/s-navigation-tablist.d.ts +36 -0
  5. package/dist/controllers/s-popover.d.ts +155 -0
  6. package/dist/controllers/s-table.d.ts +8 -0
  7. package/dist/controllers/s-tooltip.d.ts +82 -0
  8. package/dist/controllers/s-uploader.d.ts +48 -0
  9. package/dist/css/stacks.css +4633 -2703
  10. package/dist/css/stacks.min.css +1 -1
  11. package/dist/index.d.ts +3 -0
  12. package/dist/js/stacks.js +6026 -5403
  13. package/dist/js/stacks.min.js +1 -1
  14. package/dist/stacks.d.ts +21 -0
  15. package/lib/css/atomic/{_stacks-borders.less → borders.less} +30 -30
  16. package/lib/css/atomic/{_stacks-colors.less → colors.less} +0 -0
  17. package/lib/css/atomic/{_stacks-flex.less → flex.less} +14 -13
  18. package/lib/css/atomic/{_stacks-grid.less → grid.less} +12 -11
  19. package/lib/css/atomic/{_stacks-misc.less → misc.less} +23 -22
  20. package/lib/css/atomic/spacing.less +314 -0
  21. package/lib/css/atomic/{_stacks-typography.less → typography.less} +29 -29
  22. package/lib/css/atomic/width-height.less +194 -0
  23. package/lib/css/base/{_stacks-body.less → body.less} +3 -5
  24. package/lib/css/base/{_stacks-configuration-static.less → configuration-static.less} +3 -1
  25. package/lib/css/base/{_stacks-icons.less → icons.less} +0 -0
  26. package/lib/css/base/{_stacks-internals.less → internals.less} +0 -10
  27. package/lib/css/base/{_stacks-reset-meyer.less → reset-meyer.less} +0 -0
  28. package/lib/css/base/{_stacks-reset-normalize.less → reset-normalize.less} +0 -0
  29. package/lib/css/base/{_stacks-reset.less → reset.less} +2 -2
  30. package/lib/css/components/{_stacks-activity-indicator.less → activity-indicator.less} +9 -9
  31. package/lib/css/components/{_stacks-avatars.less → avatars.less} +40 -40
  32. package/lib/css/components/{_stacks-badges.less → badges.less} +11 -11
  33. package/lib/css/components/{_stacks-banners.less → banners.less} +5 -6
  34. package/lib/css/components/{_stacks-blank-states.less → blank-states.less} +2 -2
  35. package/lib/css/components/{_stacks-breadcrumbs.less → breadcrumbs.less} +7 -7
  36. package/lib/css/components/{_stacks-button-groups.less → button-groups.less} +2 -2
  37. package/lib/css/components/{_stacks-buttons.less → buttons.less} +77 -72
  38. package/lib/css/components/{_stacks-cards.less → cards.less} +2 -2
  39. package/lib/css/components/{_stacks-code-blocks.less → code-blocks.less} +8 -8
  40. package/lib/css/components/{_stacks-collapsible.less → collapsible.less} +0 -0
  41. package/lib/css/components/{_stacks-inputs.less → inputs.less} +41 -41
  42. package/lib/css/components/{_stacks-link-previews.less → link-previews.less} +17 -17
  43. package/lib/css/components/{_stacks-links.less → links.less} +4 -4
  44. package/lib/css/components/{_stacks-menu.less → menu.less} +5 -5
  45. package/lib/css/components/{_stacks-modals.less → modals.less} +20 -20
  46. package/lib/css/components/{_stacks-navigation.less → navigation.less} +12 -12
  47. package/lib/css/components/{_stacks-notices.less → notices.less} +12 -12
  48. package/lib/css/components/{_stacks-page-titles.less → page-titles.less} +9 -9
  49. package/lib/css/components/{_stacks-pagination.less → pagination.less} +8 -8
  50. package/lib/css/components/{_stacks-popovers.less → popovers.less} +17 -17
  51. package/lib/css/components/{_stacks-post-summary.less → post-summary.less} +155 -60
  52. package/lib/css/components/{_stacks-progress-bars.less → progress-bars.less} +29 -30
  53. package/lib/css/components/{_stacks-prose.less → prose.less} +31 -31
  54. package/lib/css/components/{_stacks-spinner.less → spinner.less} +14 -14
  55. package/lib/css/components/{_stacks-tables.less → tables.less} +10 -10
  56. package/lib/css/components/{_stacks-tags.less → tags.less} +33 -41
  57. package/lib/css/components/{_stacks-toggle-switches.less → toggle-switches.less} +5 -5
  58. package/lib/css/components/{_stacks-topbar.less → topbar.less} +27 -40
  59. package/lib/css/components/{_stacks-uploader.less → uploader.less} +18 -18
  60. package/lib/css/components/{_stacks-user-cards.less → user-cards.less} +14 -14
  61. package/lib/css/components/{_stacks-widget-dynamic.less → widget-dynamic.less} +1 -1
  62. package/lib/css/components/{_stacks-widget-static.less → widget-static.less} +39 -38
  63. package/lib/css/exports/{_stacks-constants-colors.less → constants-colors.less} +21 -29
  64. package/lib/css/exports/constants-helpers.less +108 -0
  65. package/lib/css/exports/constants-type.less +153 -0
  66. package/lib/css/exports/{_stacks-exports.less → exports.less} +4 -4
  67. package/lib/css/exports/{_stacks-mixins.less → mixins.less} +18 -1
  68. package/lib/css/stacks-dynamic.less +12 -13
  69. package/lib/css/stacks-static.less +38 -38
  70. package/lib/ts/controllers/index.ts +8 -0
  71. package/lib/ts/controllers/s-expandable-control.ts +163 -164
  72. package/lib/ts/controllers/s-modal.ts +259 -261
  73. package/lib/ts/controllers/s-navigation-tablist.ts +96 -97
  74. package/lib/ts/controllers/s-popover.ts +438 -440
  75. package/lib/ts/controllers/s-table.ts +203 -203
  76. package/lib/ts/controllers/s-tooltip.ts +195 -196
  77. package/lib/ts/controllers/s-uploader.ts +162 -164
  78. package/lib/ts/index.ts +20 -0
  79. package/lib/ts/stacks.ts +73 -68
  80. package/lib/tsconfig.json +8 -6
  81. package/package.json +43 -27
  82. package/dist/css/stacks-flexgrid-shim.min.css +0 -1
  83. package/lib/css/atomic/_stacks-spacing.less +0 -162
  84. package/lib/css/atomic/_stacks-width-height.less +0 -189
  85. package/lib/css/base/_stacks-configuration-dynamic.less +0 -106
  86. package/lib/css/exports/_stacks-constants-helpers.less +0 -139
  87. package/lib/css/exports/_stacks-constants-type.less +0 -91
  88. package/lib/ts/finalize.ts +0 -1
  89. package/lib/ts/stimulus.d.ts +0 -4
@@ -13,7 +13,7 @@
13
13
  min-width: auto;
14
14
  box-shadow: var(--bs-sm);
15
15
  width: 100%;
16
- z-index: @zi-navigation-fixed;
16
+ z-index: var(--zi-navigation-fixed);
17
17
  background-color: var(--theme-topbar-background-color);
18
18
  height: var(--theme-topbar-height);
19
19
  display: flex;
@@ -45,7 +45,7 @@
45
45
 
46
46
  // Wraps the content so the topbar stretches 100% w/ content at some value below that
47
47
  .s-topbar--container {
48
- width: @s-full; // wmx12; Consumers should use atomic classes to override this
48
+ width: var(--s-full); // wmx12; Consumers should use atomic classes to override this
49
49
  max-width: 100%;
50
50
  height: 100%;
51
51
  display: flex;
@@ -54,7 +54,7 @@
54
54
  }
55
55
 
56
56
  .s-topbar--logo {
57
- padding: 0 @su8;
57
+ padding: 0 var(--su8);
58
58
  height: 100%;
59
59
  display: flex;
60
60
  align-items: center;
@@ -72,7 +72,7 @@
72
72
  .s-topbar--menu-btn {
73
73
  display: flex;
74
74
  height: 100%;
75
- padding: 0 @su16;
75
+ padding: 0 var(--su16);
76
76
  flex-shrink: 0;
77
77
  align-items: center;
78
78
  justify-content: center;
@@ -83,8 +83,8 @@
83
83
  &,
84
84
  &:before,
85
85
  &:after {
86
- width: @su16;
87
- height: @su2;
86
+ width: var(--su-static16);
87
+ height: var(--su-static2);
88
88
  background-color: var(--theme-topbar-item-color);
89
89
  position: relative;
90
90
  }
@@ -156,7 +156,7 @@
156
156
  --theme-topbar-search-placeholder: @black-200;
157
157
  --theme-topbar-search-border: @black-200;
158
158
  --theme-topbar-search-border-focus: @blue-300;
159
- --theme-topbar-search-shadow-focus: 0 0 0 @su4 var(--focus-ring);
159
+ --theme-topbar-search-shadow-focus: 0 0 0 var(--su-static4) var(--focus-ring);
160
160
 
161
161
  // Search switcher
162
162
  --theme-topbar-select-color: @black-700;
@@ -207,14 +207,14 @@
207
207
  --theme-topbar-search-placeholder: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
208
208
  --theme-topbar-search-border: lighten(@topbar-actual-background, 20% + @topbar-search-lightness-increase);
209
209
  --theme-topbar-search-border-focus: lighten(@topbar-actual-background, 45% + @topbar-search-lightness-increase);
210
- --theme-topbar-search-shadow-focus: 0 0 0 @su4 fade(@white, 30%);
210
+ --theme-topbar-search-shadow-focus: 0 0 0 var(--su-static4) fade(@white, 30%);
211
211
 
212
212
  // Search switcher
213
213
  --theme-topbar-select-color: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
214
214
  --theme-topbar-select-background: lighten(@topbar-actual-background, 10% + @topbar-search-lightness-increase);
215
215
 
216
216
  // Items
217
- --theme-topbar-item-color: @black-025;
217
+ --theme-topbar-item-color: @black-100;
218
218
  --theme-topbar-item-color-hover: @white;
219
219
  --theme-topbar-item-background-hover: @black-700;
220
220
  --theme-topbar-item-color-current: @white;
@@ -243,8 +243,7 @@
243
243
  // ===========================================================================
244
244
  // $ CONTENT & CTAS
245
245
  // ---------------------------------------------------------------------------
246
- .s-topbar .s-topbar--content,
247
- .s-topbar .s-topbar--ctas {
246
+ .s-topbar .s-topbar--content {
248
247
  display: flex;
249
248
  height: 100%;
250
249
  .list-reset;
@@ -252,18 +251,16 @@
252
251
  & > li {
253
252
  display: inline-flex;
254
253
  }
255
- }
256
254
 
257
- .s-topbar .s-topbar--content {
258
255
  overflow-x: auto; // Allow this content to scroll if it gets too long
259
256
  @scrollbar-styles(); // Style the scrollbars
260
257
  margin-left: auto; // Push this section as far to the right as possible
261
258
 
262
- .s-topbar--item {
259
+ .s-topbar--item:not(.s-topbar--item__unset) {
263
260
  color: var(--theme-topbar-item-color);
264
261
  display: inline-flex;
265
262
  align-items: center;
266
- padding: 0 (@su12 - @su2);
263
+ padding: 0 calc(var(--su12) - var(--su2));
267
264
  text-decoration: none;
268
265
  white-space: nowrap;
269
266
  position: relative;
@@ -280,6 +277,7 @@
280
277
 
281
278
  .s-activity-indicator {
282
279
  top: calc(50% - 18px);
280
+ box-shadow: 0 0 0 var(--su-static2) var(--theme-topbar-item-background-hover);
283
281
  }
284
282
  }
285
283
 
@@ -291,27 +289,16 @@
291
289
  position: absolute;
292
290
  top: calc(50% - 14px);
293
291
  right: 2px;
294
- transition: top @te-smooth 0.15s;
292
+ transition: top var(--te-smooth) 0.15s;
293
+ box-shadow: 0 0 0 var(--su-static2) var(--theme-topbar-background-color);
295
294
  }
296
295
  }
297
- }
298
-
299
- // CTAs: Sign in, Sign up, etc. on the far right
300
- .s-topbar .s-topbar--ctas {
301
- padding-left: @su4;
302
- padding-right: @su8;
303
- overflow-x: auto; // Allow this content to scroll if it gets too long
304
- @scrollbar-styles(); // Style the scrollbars
305
- margin-left: auto; // Push this section as far to the right as possible
306
-
307
- li + li {
308
- margin-left: @su4;
309
- }
310
296
 
311
- .s-topbar--item {
297
+ // provide only layout styling for unset items
298
+ .s-topbar--item__unset {
312
299
  align-self: center;
313
- padding-top: @su8;
314
- padding-bottom: @su8;
300
+ padding-top: var(--su8);
301
+ padding-bottom: var(--su8);
315
302
  }
316
303
  }
317
304
 
@@ -322,10 +309,10 @@
322
309
  &:extend(.s-badge);
323
310
 
324
311
  text-transform: uppercase;
325
- font-size: @fs-fine;
312
+ font-size: var(--fs-fine);
326
313
  font-weight: 700;
327
- margin-left: @su8;
328
- margin-right: @su8;
314
+ margin-left: var(--su8);
315
+ margin-right: var(--su8);
329
316
  flex-shrink: 0;
330
317
 
331
318
  .badge-styles(transparent, transparent, var(--theme-topbar-item-color));
@@ -349,8 +336,8 @@
349
336
  // $ SEARCHBAR
350
337
  // ---------------------------------------------------------------------------
351
338
  .s-topbar .s-topbar--searchbar {
352
- @inputLineHeights: @lh-sm; // Ensure the line heights between the elements match up
353
- padding: 0 @su8;
339
+ @inputLineHeights: var(--lh-sm); // Ensure the line heights between the elements match up
340
+ padding: 0 var(--su8);
354
341
  display: flex;
355
342
  align-items: center;
356
343
  flex-shrink: 10000; // Force the searchbar to shrink as much as possible if there's no extra space
@@ -393,7 +380,7 @@
393
380
 
394
381
  &:before,
395
382
  &:after {
396
- z-index: @zi-active; // Make sure our focus ring is above the search input
383
+ z-index: var(--zi-active); // Make sure our focus ring is above the search input
397
384
  }
398
385
  }
399
386
 
@@ -409,7 +396,7 @@
409
396
  &:focus {
410
397
  border-color: var(--theme-topbar-search-border-focus);
411
398
  box-shadow: var(--theme-topbar-search-shadow-focus);
412
- z-index: @zi-selected;
399
+ z-index: var(--zi-selected);
413
400
  }
414
401
  }
415
402
 
@@ -425,7 +412,7 @@
425
412
  right: 0;
426
413
  top: 100%;
427
414
  max-width: 100%;
428
- padding: @su8 @su12;
415
+ padding: var(--su8) var(--su12);
429
416
  background: var(--theme-topbar-item-background-hover);
430
417
 
431
418
  &.s-topbar--searchbar__open {
@@ -9,11 +9,11 @@
9
9
  .s-uploader {
10
10
  align-items: center;
11
11
  background-color: var(--black-025);
12
- border-radius: @br-lg;
12
+ border-radius: var(--br-lg);
13
13
  display: flex;
14
- min-height: @su128;
14
+ min-height: var(--su-static128);
15
15
  justify-content: center;
16
- padding: @su8 @su16;
16
+ padding: var(--su8) var(--su16);
17
17
  position: relative;
18
18
  text-align: center;
19
19
 
@@ -30,7 +30,7 @@
30
30
  background-color: var(--black-150);
31
31
  -webkit-mask-image: var(--s-uploader-background-image);
32
32
  mask-image: var(--s-uploader-background-image);
33
- border-radius: @br-lg;
33
+ border-radius: var(--br-lg);
34
34
 
35
35
  .highcontrast-mode({
36
36
  background-color: var(--black-400);
@@ -117,7 +117,7 @@
117
117
 
118
118
  &:focus:focus-visible + .s-uploader--container {
119
119
  background-color: var(--black-050);
120
- box-shadow: 0 0 0 @su4 var(--focus-ring);
120
+ box-shadow: 0 0 0 var(--su-static4) var(--focus-ring);
121
121
  }
122
122
  }
123
123
 
@@ -128,9 +128,9 @@
128
128
 
129
129
  .s-uploader--preview-thumbnail {
130
130
  background-color: var(--white);
131
- border-radius: @br-sm;
131
+ border-radius: var(--br-sm);
132
132
  box-shadow: var(--bs-md);
133
- max-height: @su128;
133
+ max-height: var(--su-static128);
134
134
  max-width: 100%;
135
135
  overflow: hidden;
136
136
  text-overflow: ellipsis;
@@ -144,7 +144,7 @@
144
144
  }
145
145
 
146
146
  &:not(img) {
147
- padding: @su16;
147
+ padding: var(--su16);
148
148
  }
149
149
  }
150
150
 
@@ -155,19 +155,19 @@
155
155
  &.has-multiple {
156
156
  display: block;
157
157
  height: auto;
158
- padding: @su8 @su2;
158
+ padding: var(--su8) var(--su2);
159
159
  width: 100%;
160
160
 
161
161
  .s-uploader--preview {
162
162
  align-items: center;
163
163
  display: flex;
164
- padding: @su6 0;
164
+ padding: var(--su6) 0;
165
165
  width: 100%;
166
166
 
167
167
  &:after {
168
168
  content: attr(data-filename);
169
169
  display: block;
170
- margin-left: @su12;
170
+ margin-left: var(--su12);
171
171
  max-width: 100%;
172
172
  overflow: hidden;
173
173
  text-overflow: ellipsis;
@@ -177,9 +177,9 @@
177
177
 
178
178
  .s-uploader--preview-thumbnail {
179
179
  color: transparent;
180
- height: @su32;
180
+ height: var(--su-static32);
181
181
  flex-shrink: 0;
182
- width: @su32;
182
+ width: var(--su-static32);
183
183
 
184
184
  &:is(img) {
185
185
  object-fit: cover;
@@ -196,15 +196,15 @@
196
196
 
197
197
  .s-uploader--previews-heading {
198
198
  color: var(--black-900);
199
- font-size: @fs-body2;
199
+ font-size: var(--fs-body2);
200
200
  font-weight: 600;
201
- padding-bottom: @su8;
201
+ padding-bottom: var(--su8);
202
202
  }
203
203
 
204
204
  .s-uploader--reset {
205
205
  position: absolute;
206
- right: @su8;
207
- top: @su8;
208
- z-index: @zi-active;
206
+ right: var(--su8);
207
+ top: var(--su8);
208
+ z-index: var(--zi-active);
209
209
  }
210
210
  }
@@ -13,11 +13,11 @@
13
13
  .s-user-card {
14
14
  display: grid;
15
15
  grid-template-columns: auto 1fr;
16
- column-gap: @su8;
17
- row-gap: @su4;
16
+ column-gap: var(--su8);
17
+ row-gap: var(--su4);
18
18
  align-items: center;
19
19
  line-height: 1;
20
- padding: @su8;
20
+ padding: var(--su8);
21
21
 
22
22
  // ===========================================================================
23
23
  // $ STYLE VARIATIONS
@@ -27,7 +27,7 @@
27
27
  // ---------------------------------------------------------------------------
28
28
  &.s-user-card__highlighted {
29
29
  background-color: var(--theme-secondary-050);
30
- border-radius: @br-md;
30
+ border-radius: var(--br-md);
31
31
 
32
32
  .s-user-card--type {
33
33
  color: var(--black-700);
@@ -40,7 +40,7 @@
40
40
  align-items: start;
41
41
 
42
42
  .s-user-card--link {
43
- font-size: @fs-body2;
43
+ font-size: var(--fs-body2);
44
44
  }
45
45
  }
46
46
 
@@ -55,7 +55,7 @@
55
55
  &.s-user-card__small {
56
56
  display: flex;
57
57
  align-items: center;
58
- gap: @su4;
58
+ gap: var(--su4);
59
59
  padding: 0;
60
60
 
61
61
  .s-user-card--info {
@@ -69,7 +69,7 @@
69
69
  &.s-user-card__minimal {
70
70
  display: flex;
71
71
  align-items: center;
72
- gap: @su4;
72
+ gap: var(--su4);
73
73
  padding: 0;
74
74
 
75
75
  .s-user-card--time {
@@ -92,7 +92,7 @@
92
92
 
93
93
  .s-user-card--type {
94
94
  grid-column: ~"1 / 3";
95
- font-size: @fs-caption;
95
+ font-size: var(--fs-caption);
96
96
  color: var(--theme-primary-400);
97
97
 
98
98
  a {
@@ -108,7 +108,7 @@
108
108
  grid-column: ~"1 / 3";
109
109
  grid-row: ~"1 / 2";
110
110
  color: var(--black-500);
111
- font-size: @fs-caption;
111
+ font-size: var(--fs-caption);
112
112
  }
113
113
 
114
114
  // $ USER INFO CONTAINER
@@ -118,7 +118,7 @@
118
118
  .s-user-card--info {
119
119
  display: flex;
120
120
  flex-direction: column;
121
- gap: @su4;
121
+ gap: var(--su4);
122
122
  }
123
123
 
124
124
  // $ USER LINK
@@ -126,7 +126,7 @@
126
126
  // ---------------------------------------------------------------------------
127
127
  .s-user-card--link {
128
128
  min-width: 0; // Allow things to wrap
129
- font-size: @fs-caption;
129
+ font-size: var(--fs-caption);
130
130
  align-items: center;
131
131
  flex-wrap: wrap;
132
132
  overflow-wrap: break-word;
@@ -139,10 +139,10 @@
139
139
  .list-reset;
140
140
  display: flex;
141
141
  align-items: center;
142
- gap: @su6;
142
+ gap: var(--su6);
143
143
 
144
144
  li {
145
- font-size: @fs-caption;
145
+ font-size: var(--fs-caption);
146
146
  }
147
147
  }
148
148
 
@@ -155,7 +155,7 @@
155
155
  // ---------------------------------------------------------------------------
156
156
  .s-user-card--location,
157
157
  .s-user-card--role {
158
- font-size: @fs-caption;
158
+ font-size: var(--fs-caption);
159
159
  color: var(--black-500);
160
160
  }
161
161
 
@@ -9,7 +9,7 @@
9
9
  // This file only sets the colors for the "current color" highlight when the
10
10
  // widget is used for navigation. This is the only part of the widget that is
11
11
  // dynamically configurable; the rest can be served in the static part of Stacks
12
- // and is in _stacks-widget-static.less.
12
+ // and is in widget-static.less.
13
13
 
14
14
  .s-sidebarwidget--item {
15
15
  &,
@@ -9,23 +9,22 @@
9
9
  // This file contains almost all the CSS for the sidebar widget. The only exception
10
10
  // is the "current color" highlight when the widget is used for navigation. That
11
11
  // part is configurable and is in the dynamic part of Stacks as
12
- // _stacks-widget-dynamic.less.
12
+ // widget-dynamic.less.
13
13
 
14
+ .s-sidebarwidget {
15
+ --s-sidebarwidget-content-padding: calc(var(--su16) - var(--su1)); // subtract 1px for border
16
+ --s-sidebarwidget-content-inner-spacing: var(--su12); // the spacing between two adjacent simple items
17
+ --s-sidebarwidget-content-outer-spacing: var(--su16); // the spacing at the start/end of a group of simple items, as well as between a complex item and its separator line
14
18
 
15
- @s-sidebarwidget-content-padding: @su16 - 1px; // subtract 1px for border
16
- @s-sidebarwidget-content-inner-spacing: @su12; // the spacing between two adjacent simple items
17
- @s-sidebarwidget-content-outer-spacing: @su16; // the spacing at the start/end of a group of simple items, as well as between a complex item and its separator line
18
-
19
- @s-sidebarwidget-outer-border-color: var(--bc-medium);
20
- @s-sidebarwidget-content-separator-color: var(--bc-light);
21
- @s-sidebarwidget-header-background-color: var(--black-025);
19
+ --s-sidebarwidget-outer-border-color: var(--bc-medium);
20
+ --s-sidebarwidget-content-separator-color: var(--bc-light);
21
+ --s-sidebarwidget-header-background-color: var(--black-025);
22
22
 
23
- .s-sidebarwidget {
24
23
  position: relative; // so that it's the positioning parent for the :after
25
- border: 1px solid @s-sidebarwidget-outer-border-color;
26
- border-radius: @br-sm;
24
+ border: 1px solid var(--s-sidebarwidget-outer-border-color);
25
+ border-radius: var(--br-sm);
27
26
  box-shadow: var(--bs-sm);
28
- font-size: @fs-body1;
27
+ font-size: var(--fs-body1);
29
28
  background-color: var(--white);
30
29
 
31
30
  &:not(.s-anchors) a:not(.button):not(.s-btn):not(.post-tag):not(.s-sidebarwidget--action):not(.s-user-card--link) {
@@ -61,9 +60,10 @@
61
60
  top: -1px;
62
61
  right: -1px;
63
62
  left: -1px;
64
- height: 2px + @br-sm; // we need 2px border + 2px border radius to have the correct corner shape
65
- border-top: 1px solid @s-sidebarwidget-outer-border-color;
66
- border-radius: @br-sm;
63
+ // TODO: this makes no sense. revisit.
64
+ height: calc(2px + var(--br-sm)); // we need 2px border + 2px border radius to have the correct corner shape
65
+ border-top: 1px solid var(--s-sidebarwidget-outer-border-color);
66
+ border-radius: var(--br-sm);
67
67
  pointer-events: none; // if the top item is clickable, then we don't want to prevent clicking the top 2 pixels
68
68
 
69
69
  // In order to also perfectly recreate the inner corner shape, our pseudo-element needs
@@ -72,14 +72,14 @@
72
72
  @supports ((-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)) or (clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%))) or (-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)) {
73
73
  -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
74
74
  clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
75
- border: 1px solid @s-sidebarwidget-outer-border-color;
75
+ border: 1px solid var(--s-sidebarwidget-outer-border-color);
76
76
  }
77
77
  }
78
78
  }
79
79
 
80
80
  .s-sidebarwidget--header,
81
81
  .s-sidebarwidget--content {
82
- border-top: 1px solid @s-sidebarwidget-content-separator-color;
82
+ border-top: 1px solid var(--s-sidebarwidget-content-separator-color);
83
83
 
84
84
  &:active {
85
85
  outline: none;
@@ -88,23 +88,23 @@
88
88
 
89
89
 
90
90
  .s-sidebarwidget--header {
91
- padding: @s-sidebarwidget-content-inner-spacing @s-sidebarwidget-content-padding;
92
- background: @s-sidebarwidget-header-background-color;
91
+ padding: var(--s-sidebarwidget-content-inner-spacing) var(--s-sidebarwidget-content-padding);
92
+ background: var(--s-sidebarwidget-header-background-color);
93
93
  color: var(--black-600);
94
- font-size: @fs-body2;
94
+ font-size: var(--fs-body2);
95
95
  font-weight: normal;
96
96
 
97
97
  &:first-child {
98
- border-top-left-radius: @br-sm;
99
- border-top-right-radius: @br-sm;
98
+ border-top-left-radius: var(--br-sm);
99
+ border-top-right-radius: var(--br-sm);
100
100
  }
101
101
 
102
102
  &.s-sidebarwidget__small-bold-text {
103
- font-size: @fs-caption;
103
+ font-size: var(--fs-caption);
104
104
  font-weight: bold;
105
105
  .-action {
106
106
  font-weight: normal;
107
- line-height: 1.3 * @fs-caption; // line-height should be the same as in the outside element, so the header and action baselines line up
107
+ line-height: calc(1.3 * var(--fs-caption)); // line-height should be the same as in the outside element, so the header and action baselines line up
108
108
  }
109
109
  }
110
110
 
@@ -114,7 +114,7 @@
114
114
  content: '';
115
115
  float: left;
116
116
  margin-top: ~"calc(1.3em / 2 - 5px)"; // 1.3 is our standard line height
117
- margin-right: @su12;
117
+ margin-right: var(--su12);
118
118
  border: 5px solid transparent;
119
119
  border-left-color: var(--bc-darker);
120
120
  border-right-width: 0;
@@ -131,16 +131,16 @@
131
131
 
132
132
  .s-sidebarwidget--action {
133
133
  float: right;
134
- margin: 0 0 @su4 @su8;
134
+ margin: 0 0 var(--su4) var(--su8);
135
135
  color: var(--blue);
136
- font-size: @fs-fine;
136
+ font-size: var(--fs-fine);
137
137
  line-height: 1.3 * 15px; // line-height should be the same as in the outside element, so the header and action baselines line up
138
138
  }
139
139
 
140
140
  table.s-sidebarwidget--content.s-sidebarwidget__items {
141
- padding: (@s-sidebarwidget-content-outer-spacing - @s-sidebarwidget-content-inner-spacing) (@s-sidebarwidget-content-padding - @s-sidebarwidget-content-inner-spacing);
141
+ padding: calc(var(--s-sidebarwidget-content-outer-spacing) - var(--s-sidebarwidget-content-inner-spacing)) calc(var(--s-sidebarwidget-content-padding) - var(--s-sidebarwidget-content-inner-spacing));
142
142
  border-collapse: separate;
143
- border-spacing: @s-sidebarwidget-content-inner-spacing;
143
+ border-spacing: var(--s-sidebarwidget-content-inner-spacing);
144
144
 
145
145
  tr.-item {
146
146
  display: table-row;
@@ -161,12 +161,12 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
161
161
 
162
162
  .s-sidebarwidget--content {
163
163
  margin: 0;
164
- padding: @s-sidebarwidget-content-outer-spacing @s-sidebarwidget-content-padding;
164
+ padding: var(--s-sidebarwidget-content-outer-spacing) var(--s-sidebarwidget-content-padding);
165
165
 
166
166
  &.s-sidebarwidget__items {
167
167
  display: block;
168
168
  // the items themselves provide part of the spacing, so the content padding needs to account for that
169
- padding: (@s-sidebarwidget-content-outer-spacing - @s-sidebarwidget-content-inner-spacing) @s-sidebarwidget-content-padding;
169
+ padding: calc(var(--s-sidebarwidget-content-outer-spacing) - var(--s-sidebarwidget-content-inner-spacing)) var(--s-sidebarwidget-content-padding);
170
170
  &.s-sidebarwidget__block-items .s-sidebarwidget--item {
171
171
  .d-block;
172
172
  }
@@ -174,7 +174,7 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
174
174
  }
175
175
 
176
176
  .s-sidebarwidget--item {
177
- margin: @s-sidebarwidget-content-inner-spacing 0;
177
+ margin: var(--s-sidebarwidget-content-inner-spacing) 0;
178
178
 
179
179
  &,
180
180
  & > :first-child {
@@ -188,12 +188,12 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
188
188
  content: '';
189
189
  position: absolute;
190
190
  left: 0;
191
- height: ~"calc(100% +" @s-sidebarwidget-content-inner-spacing ~")";
192
- margin-top: -(@s-sidebarwidget-content-inner-spacing / 2);
193
- margin-left: -@s-sidebarwidget-content-padding - 1; // the orange selection indicator overlaps with the widget border
191
+ height: calc(100% + var(--s-sidebarwidget-content-inner-spacing));
192
+ margin-top: calc(var(--s-sidebarwidget-content-inner-spacing) / 2 * -1);
193
+ margin-left: calc(var(--s-sidebarwidget-content-padding) * -1 - 1px); // the orange selection indicator overlaps with the widget border
194
194
  border-left-width: 3px;
195
195
  border-left-style: solid;
196
- // border-left-color is set in _stacks-widget-dynamic.less
196
+ // border-left-color is set in widget-dynamic.less
197
197
  }
198
198
 
199
199
  a,
@@ -203,10 +203,11 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
203
203
  }
204
204
  }
205
205
  }
206
+
206
207
  .s-sidebarwidget--subnav {
207
208
  list-style-type: none;
208
209
  padding-left: 0;
209
- margin-left: @su8;
210
+ margin-left: var(--su8);
210
211
 
211
212
  li {
212
213
  margin-top: 12px;
@@ -219,7 +220,7 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
219
220
 
220
221
  &[aria-current="true"],
221
222
  &[aria-current="page"] {
222
- // this is given a bullet-arrow in the primary color in _stacks-widget-dynamic.less
223
+ // this is given a bullet-arrow in the primary color in widget-dynamic.less
223
224
  color: var(--black);
224
225
  font-weight: bold;
225
226