@stackoverflow/stacks 0.75.0 → 0.76.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 (87) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +47 -47
  3. package/dist/controllers/index.d.ts +7 -0
  4. package/dist/controllers/s-expandable-control.d.ts +17 -0
  5. package/dist/controllers/s-modal.d.ts +97 -0
  6. package/dist/controllers/s-navigation-tablist.d.ts +36 -0
  7. package/dist/controllers/s-popover.d.ts +155 -0
  8. package/dist/controllers/s-table.d.ts +8 -0
  9. package/dist/controllers/s-tooltip.d.ts +82 -0
  10. package/dist/controllers/s-uploader.d.ts +48 -0
  11. package/dist/css/stacks.css +86 -53
  12. package/dist/css/stacks.min.css +1 -1
  13. package/dist/index.d.ts +3 -0
  14. package/dist/js/stacks.js +6128 -5505
  15. package/dist/js/stacks.min.js +1 -1
  16. package/dist/stacks.d.ts +21 -0
  17. package/lib/css/atomic/_stacks-borders.less +378 -378
  18. package/lib/css/atomic/_stacks-colors.less +209 -209
  19. package/lib/css/atomic/_stacks-flex.less +374 -374
  20. package/lib/css/atomic/_stacks-grid.less +174 -173
  21. package/lib/css/atomic/_stacks-misc.less +343 -343
  22. package/lib/css/atomic/_stacks-spacing.less +168 -168
  23. package/lib/css/atomic/_stacks-typography.less +273 -273
  24. package/lib/css/atomic/_stacks-width-height.less +195 -195
  25. package/lib/css/base/_stacks-body.less +44 -46
  26. package/lib/css/base/_stacks-configuration-static.less +59 -59
  27. package/lib/css/base/_stacks-icons.less +20 -20
  28. package/lib/css/base/_stacks-internals.less +220 -230
  29. package/lib/css/base/_stacks-reset-meyer.less +64 -64
  30. package/lib/css/base/_stacks-reset-normalize.less +449 -449
  31. package/lib/css/base/_stacks-reset.less +20 -20
  32. package/lib/css/components/_stacks-activity-indicator.less +45 -45
  33. package/lib/css/components/_stacks-avatars.less +189 -189
  34. package/lib/css/components/_stacks-badges.less +209 -209
  35. package/lib/css/components/_stacks-banners.less +80 -81
  36. package/lib/css/components/_stacks-blank-states.less +26 -26
  37. package/lib/css/components/_stacks-breadcrumbs.less +44 -44
  38. package/lib/css/components/_stacks-button-groups.less +104 -104
  39. package/lib/css/components/_stacks-buttons.less +658 -660
  40. package/lib/css/components/_stacks-cards.less +44 -44
  41. package/lib/css/components/_stacks-code-blocks.less +130 -130
  42. package/lib/css/components/_stacks-collapsible.less +104 -104
  43. package/lib/css/components/_stacks-inputs.less +728 -728
  44. package/lib/css/components/_stacks-link-previews.less +136 -136
  45. package/lib/css/components/_stacks-links.less +218 -218
  46. package/lib/css/components/_stacks-menu.less +47 -47
  47. package/lib/css/components/_stacks-modals.less +133 -133
  48. package/lib/css/components/_stacks-navigation.less +146 -146
  49. package/lib/css/components/_stacks-notices.less +233 -233
  50. package/lib/css/components/_stacks-page-titles.less +60 -60
  51. package/lib/css/components/_stacks-pagination.less +55 -55
  52. package/lib/css/components/_stacks-popovers.less +197 -197
  53. package/lib/css/components/_stacks-post-summary.less +425 -425
  54. package/lib/css/components/_stacks-progress-bars.less +331 -331
  55. package/lib/css/components/_stacks-prose.less +503 -503
  56. package/lib/css/components/_stacks-spinner.less +107 -107
  57. package/lib/css/components/_stacks-tables.less +341 -341
  58. package/lib/css/components/_stacks-tags.less +236 -244
  59. package/lib/css/components/_stacks-toggle-switches.less +144 -144
  60. package/lib/css/components/_stacks-topbar.less +425 -440
  61. package/lib/css/components/_stacks-uploader.less +210 -210
  62. package/lib/css/components/_stacks-user-cards.less +169 -169
  63. package/lib/css/components/_stacks-widget-dynamic.less +33 -33
  64. package/lib/css/components/_stacks-widget-static.less +272 -272
  65. package/lib/css/exports/_stacks-constants-colors.less +1112 -1112
  66. package/lib/css/exports/_stacks-constants-helpers.less +139 -139
  67. package/lib/css/exports/_stacks-constants-type.less +152 -91
  68. package/lib/css/exports/_stacks-exports.less +15 -15
  69. package/lib/css/exports/_stacks-mixins.less +220 -220
  70. package/lib/css/stacks-dynamic.less +35 -36
  71. package/lib/css/stacks-static.less +86 -86
  72. package/lib/ts/controllers/index.ts +8 -0
  73. package/lib/ts/controllers/s-expandable-control.ts +189 -190
  74. package/lib/ts/controllers/s-modal.ts +321 -323
  75. package/lib/ts/controllers/s-navigation-tablist.ts +118 -119
  76. package/lib/ts/controllers/s-popover.ts +547 -549
  77. package/lib/ts/controllers/s-table.ts +220 -220
  78. package/lib/ts/controllers/s-tooltip.ts +246 -247
  79. package/lib/ts/controllers/s-uploader.ts +172 -174
  80. package/lib/ts/index.ts +20 -0
  81. package/lib/ts/stacks.ts +88 -83
  82. package/lib/tsconfig.json +13 -11
  83. package/package.json +87 -71
  84. package/dist/css/stacks-flexgrid-shim.min.css +0 -1
  85. package/lib/css/base/_stacks-configuration-dynamic.less +0 -106
  86. package/lib/ts/finalize.ts +0 -1
  87. package/lib/ts/stimulus.d.ts +0 -4
@@ -1,272 +1,272 @@
1
- //
2
- // STACK OVERFLOW
3
- // SIDEBAR WIDGET -- STATIC PARTS
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // This file contains almost all the CSS for the sidebar widget. The only exception
10
- // is the "current color" highlight when the widget is used for navigation. That
11
- // part is configurable and is in the dynamic part of Stacks as
12
- // _stacks-widget-dynamic.less.
13
-
14
-
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);
22
-
23
- .s-sidebarwidget {
24
- 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;
27
- box-shadow: var(--bs-sm);
28
- font-size: @fs-body1;
29
- background-color: var(--white);
30
-
31
- &:not(.s-anchors) a:not(.button):not(.s-btn):not(.post-tag):not(.s-sidebarwidget--action):not(.s-user-card--link) {
32
- &,
33
- &:visited {
34
- color: var(--black-500);
35
- }
36
- }
37
-
38
- // We must support things like collapsible (in particular invisble) elements, wrapper elements,
39
- // etc. Therefore every .-content and .-header must stand on its own; we cannot rely on things
40
- // like :first-child, because the *first* child may not be the first *visible* child, and it may
41
- // also be the :first-child of some wrapper. This is why every .-header and .-content has a
42
- // border-top. But because you shouldn't see the first visible item's or header's top border
43
- // (the widget itself provides for that border), we shift everything up by one pixel with the following pseudo-element.
44
- &:before {
45
- content: '';
46
- display: block;
47
- margin-top: -1px;
48
- }
49
-
50
- // However, because of the above, the top item's divider line now sits above the .s-sidebarwidget's top
51
- // border. We could fix this by using overflow: hidden, but that would constrain users of
52
- // .s-sidebarwidget to never have things like tooltips, autocompletes or the like that reach outside
53
- // the widget boundaries.
54
- // What we do instead is re-create the widget's top border in an absolutely positioned :after,
55
- // which sits above our item's top border. Technically, a tiny corner of the item's border will
56
- // still be visible, but at its highest point, this corner has a height of 0.27 pixels. And for
57
- // this sub-pixel issues, we're talking about different shades of gray. So we can live with that.
58
- &:after {
59
- content: '';
60
- position: absolute;
61
- top: -1px;
62
- right: -1px;
63
- 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;
67
- pointer-events: none; // if the top item is clickable, then we don't want to prevent clicking the top 2 pixels
68
-
69
- // In order to also perfectly recreate the inner corner shape, our pseudo-element needs
70
- // the border on all sides. But we can only do that if we're able to hide the bottom part,
71
- // so this only works in browsers that support clip-path.
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
- -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
74
- clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
75
- border: 1px solid @s-sidebarwidget-outer-border-color;
76
- }
77
- }
78
- }
79
-
80
- .s-sidebarwidget--header,
81
- .s-sidebarwidget--content {
82
- border-top: 1px solid @s-sidebarwidget-content-separator-color;
83
-
84
- &:active {
85
- outline: none;
86
- }
87
- }
88
-
89
-
90
- .s-sidebarwidget--header {
91
- padding: @s-sidebarwidget-content-inner-spacing @s-sidebarwidget-content-padding;
92
- background: @s-sidebarwidget-header-background-color;
93
- color: var(--black-600);
94
- font-size: @fs-body2;
95
- font-weight: normal;
96
-
97
- &:first-child {
98
- border-top-left-radius: @br-sm;
99
- border-top-right-radius: @br-sm;
100
- }
101
-
102
- &.s-sidebarwidget__small-bold-text {
103
- font-size: @fs-caption;
104
- font-weight: bold;
105
- .-action {
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
108
- }
109
- }
110
-
111
- &.s-sidebarwidget__expanding-control {
112
- cursor: pointer;
113
- &:before {
114
- content: '';
115
- float: left;
116
- margin-top: ~"calc(1.3em / 2 - 5px)"; // 1.3 is our standard line height
117
- margin-right: @su12;
118
- border: 5px solid transparent;
119
- border-left-color: var(--bc-darker);
120
- border-right-width: 0;
121
- transition: -webkit-transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1);
122
- transition: transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1);
123
- transition: transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1), -webkit-transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1);
124
- }
125
- &[aria-expanded='true']:before {
126
- -webkit-transform: rotate(90deg);
127
- transform: rotate(90deg);
128
- }
129
- }
130
- }
131
-
132
- .s-sidebarwidget--action {
133
- float: right;
134
- margin: 0 0 @su4 @su8;
135
- color: var(--blue);
136
- font-size: @fs-fine;
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
- }
139
-
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);
142
- border-collapse: separate;
143
- border-spacing: @s-sidebarwidget-content-inner-spacing;
144
-
145
- tr.-item {
146
- display: table-row;
147
- td {
148
- padding: 0;
149
- }
150
- }
151
- }
152
-
153
- .s-sidebarwidget--content:not(table) {
154
- &:not(.s-sidebarwidget__items) {
155
- display: flex;
156
- }
157
- &:not(.s-sidebarwidget__block-items) .s-sidebarwidget--item {
158
- display: flex;
159
- }
160
- }
161
-
162
- .s-sidebarwidget--content {
163
- margin: 0;
164
- padding: @s-sidebarwidget-content-outer-spacing @s-sidebarwidget-content-padding;
165
-
166
- &.s-sidebarwidget__items {
167
- display: block;
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;
170
- &.s-sidebarwidget__block-items .s-sidebarwidget--item {
171
- .d-block;
172
- }
173
- }
174
- }
175
-
176
- .s-sidebarwidget--item {
177
- margin: @s-sidebarwidget-content-inner-spacing 0;
178
-
179
- &,
180
- & > :first-child {
181
- &[aria-current="true"],
182
- &[aria-current="page"] {
183
- position: relative;
184
- color: var(--black);
185
- font-weight: bold;
186
-
187
- &:before {
188
- content: '';
189
- position: absolute;
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
194
- border-left-width: 3px;
195
- border-left-style: solid;
196
- // border-left-color is set in _stacks-widget-dynamic.less
197
- }
198
-
199
- a,
200
- a:visited { // TODO: this isn't the best way to go about this. There should be a "is current" highlight without font modification for more complex cases
201
- color: inherit;
202
- }
203
- }
204
- }
205
- }
206
- .s-sidebarwidget--subnav {
207
- list-style-type: none;
208
- padding-left: 0;
209
- margin-left: @su8;
210
-
211
- li {
212
- margin-top: 12px;
213
- padding-left: 16px;
214
- background-position: 0 calc((1.2em - 10px) / 2);
215
- background-repeat: no-repeat;
216
- background-size: auto 10px;
217
-
218
- #stacks-internals #bullet-arrow(var(--black-100));
219
-
220
- &[aria-current="true"],
221
- &[aria-current="page"] {
222
- // this is given a bullet-arrow in the primary color in _stacks-widget-dynamic.less
223
- color: var(--black);
224
- font-weight: bold;
225
-
226
- a,
227
- a:visited { // TODO: see above
228
- color: inherit;
229
- }
230
- }
231
- }
232
- }
233
-
234
- // COLOR ALTERNATIVES
235
- // todo: use CSS custom properties for this once we don't care about IE anymore
236
-
237
- .alternate-color(blue);
238
- .alternate-color(yellow);
239
- .alternate-color(green);
240
-
241
- .alternate-color(@name) {
242
- &.s-sidebarwidget__@{name} {
243
- border-color: var(~"--@{name}-200");
244
- background-color: var(~"--@{name}-050");
245
-
246
- .highcontrast-mode({
247
- border-color: var(~"--@{name}-700");
248
- });
249
-
250
- .s-sidebarwidget--header {
251
- background-color: var(~"--@{name}-100");
252
- color: var(--fc-medium);
253
- }
254
-
255
- .s-sidebarwidget--header,
256
- .s-sidebarwidget--content {
257
- border-color: var(~"--@{name}-200");
258
-
259
- .highcontrast-mode({
260
- border-color: var(~"--@{name}-700");
261
- });
262
- }
263
-
264
- &:after {
265
- border-color: var(~"--@{name}-200");
266
-
267
- .highcontrast-mode({
268
- border-color: var(~"--@{name}-700");
269
- });
270
- }
271
- }
272
- }
1
+ //
2
+ // STACK OVERFLOW
3
+ // SIDEBAR WIDGET -- STATIC PARTS
4
+ //
5
+ // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
+ // Stack Overflow. For documentation of all these classes and how to contribute,
7
+ // visit https://stackoverflow.design/
8
+ //
9
+ // This file contains almost all the CSS for the sidebar widget. The only exception
10
+ // is the "current color" highlight when the widget is used for navigation. That
11
+ // part is configurable and is in the dynamic part of Stacks as
12
+ // _stacks-widget-dynamic.less.
13
+
14
+
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);
22
+
23
+ .s-sidebarwidget {
24
+ 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;
27
+ box-shadow: var(--bs-sm);
28
+ font-size: @fs-body1;
29
+ background-color: var(--white);
30
+
31
+ &:not(.s-anchors) a:not(.button):not(.s-btn):not(.post-tag):not(.s-sidebarwidget--action):not(.s-user-card--link) {
32
+ &,
33
+ &:visited {
34
+ color: var(--black-500);
35
+ }
36
+ }
37
+
38
+ // We must support things like collapsible (in particular invisble) elements, wrapper elements,
39
+ // etc. Therefore every .-content and .-header must stand on its own; we cannot rely on things
40
+ // like :first-child, because the *first* child may not be the first *visible* child, and it may
41
+ // also be the :first-child of some wrapper. This is why every .-header and .-content has a
42
+ // border-top. But because you shouldn't see the first visible item's or header's top border
43
+ // (the widget itself provides for that border), we shift everything up by one pixel with the following pseudo-element.
44
+ &:before {
45
+ content: '';
46
+ display: block;
47
+ margin-top: -1px;
48
+ }
49
+
50
+ // However, because of the above, the top item's divider line now sits above the .s-sidebarwidget's top
51
+ // border. We could fix this by using overflow: hidden, but that would constrain users of
52
+ // .s-sidebarwidget to never have things like tooltips, autocompletes or the like that reach outside
53
+ // the widget boundaries.
54
+ // What we do instead is re-create the widget's top border in an absolutely positioned :after,
55
+ // which sits above our item's top border. Technically, a tiny corner of the item's border will
56
+ // still be visible, but at its highest point, this corner has a height of 0.27 pixels. And for
57
+ // this sub-pixel issues, we're talking about different shades of gray. So we can live with that.
58
+ &:after {
59
+ content: '';
60
+ position: absolute;
61
+ top: -1px;
62
+ right: -1px;
63
+ 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;
67
+ pointer-events: none; // if the top item is clickable, then we don't want to prevent clicking the top 2 pixels
68
+
69
+ // In order to also perfectly recreate the inner corner shape, our pseudo-element needs
70
+ // the border on all sides. But we can only do that if we're able to hide the bottom part,
71
+ // so this only works in browsers that support clip-path.
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
+ -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
74
+ clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
75
+ border: 1px solid @s-sidebarwidget-outer-border-color;
76
+ }
77
+ }
78
+ }
79
+
80
+ .s-sidebarwidget--header,
81
+ .s-sidebarwidget--content {
82
+ border-top: 1px solid @s-sidebarwidget-content-separator-color;
83
+
84
+ &:active {
85
+ outline: none;
86
+ }
87
+ }
88
+
89
+
90
+ .s-sidebarwidget--header {
91
+ padding: @s-sidebarwidget-content-inner-spacing @s-sidebarwidget-content-padding;
92
+ background: @s-sidebarwidget-header-background-color;
93
+ color: var(--black-600);
94
+ font-size: @fs-body2;
95
+ font-weight: normal;
96
+
97
+ &:first-child {
98
+ border-top-left-radius: @br-sm;
99
+ border-top-right-radius: @br-sm;
100
+ }
101
+
102
+ &.s-sidebarwidget__small-bold-text {
103
+ font-size: @fs-caption;
104
+ font-weight: bold;
105
+ .-action {
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
108
+ }
109
+ }
110
+
111
+ &.s-sidebarwidget__expanding-control {
112
+ cursor: pointer;
113
+ &:before {
114
+ content: '';
115
+ float: left;
116
+ margin-top: ~"calc(1.3em / 2 - 5px)"; // 1.3 is our standard line height
117
+ margin-right: @su12;
118
+ border: 5px solid transparent;
119
+ border-left-color: var(--bc-darker);
120
+ border-right-width: 0;
121
+ transition: -webkit-transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1);
122
+ transition: transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1);
123
+ transition: transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1), -webkit-transform 0.3s cubic-bezier(0.4, 0.4, 0.6, 1);
124
+ }
125
+ &[aria-expanded='true']:before {
126
+ -webkit-transform: rotate(90deg);
127
+ transform: rotate(90deg);
128
+ }
129
+ }
130
+ }
131
+
132
+ .s-sidebarwidget--action {
133
+ float: right;
134
+ margin: 0 0 @su4 @su8;
135
+ color: var(--blue);
136
+ font-size: @fs-fine;
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
+ }
139
+
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);
142
+ border-collapse: separate;
143
+ border-spacing: @s-sidebarwidget-content-inner-spacing;
144
+
145
+ tr.-item {
146
+ display: table-row;
147
+ td {
148
+ padding: 0;
149
+ }
150
+ }
151
+ }
152
+
153
+ .s-sidebarwidget--content:not(table) {
154
+ &:not(.s-sidebarwidget__items) {
155
+ display: flex;
156
+ }
157
+ &:not(.s-sidebarwidget__block-items) .s-sidebarwidget--item {
158
+ display: flex;
159
+ }
160
+ }
161
+
162
+ .s-sidebarwidget--content {
163
+ margin: 0;
164
+ padding: @s-sidebarwidget-content-outer-spacing @s-sidebarwidget-content-padding;
165
+
166
+ &.s-sidebarwidget__items {
167
+ display: block;
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;
170
+ &.s-sidebarwidget__block-items .s-sidebarwidget--item {
171
+ .d-block;
172
+ }
173
+ }
174
+ }
175
+
176
+ .s-sidebarwidget--item {
177
+ margin: @s-sidebarwidget-content-inner-spacing 0;
178
+
179
+ &,
180
+ & > :first-child {
181
+ &[aria-current="true"],
182
+ &[aria-current="page"] {
183
+ position: relative;
184
+ color: var(--black);
185
+ font-weight: bold;
186
+
187
+ &:before {
188
+ content: '';
189
+ position: absolute;
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
194
+ border-left-width: 3px;
195
+ border-left-style: solid;
196
+ // border-left-color is set in _stacks-widget-dynamic.less
197
+ }
198
+
199
+ a,
200
+ a:visited { // TODO: this isn't the best way to go about this. There should be a "is current" highlight without font modification for more complex cases
201
+ color: inherit;
202
+ }
203
+ }
204
+ }
205
+ }
206
+ .s-sidebarwidget--subnav {
207
+ list-style-type: none;
208
+ padding-left: 0;
209
+ margin-left: @su8;
210
+
211
+ li {
212
+ margin-top: 12px;
213
+ padding-left: 16px;
214
+ background-position: 0 calc((1.2em - 10px) / 2);
215
+ background-repeat: no-repeat;
216
+ background-size: auto 10px;
217
+
218
+ #stacks-internals #bullet-arrow(var(--black-100));
219
+
220
+ &[aria-current="true"],
221
+ &[aria-current="page"] {
222
+ // this is given a bullet-arrow in the primary color in _stacks-widget-dynamic.less
223
+ color: var(--black);
224
+ font-weight: bold;
225
+
226
+ a,
227
+ a:visited { // TODO: see above
228
+ color: inherit;
229
+ }
230
+ }
231
+ }
232
+ }
233
+
234
+ // COLOR ALTERNATIVES
235
+ // todo: use CSS custom properties for this once we don't care about IE anymore
236
+
237
+ .alternate-color(blue);
238
+ .alternate-color(yellow);
239
+ .alternate-color(green);
240
+
241
+ .alternate-color(@name) {
242
+ &.s-sidebarwidget__@{name} {
243
+ border-color: var(~"--@{name}-200");
244
+ background-color: var(~"--@{name}-050");
245
+
246
+ .highcontrast-mode({
247
+ border-color: var(~"--@{name}-700");
248
+ });
249
+
250
+ .s-sidebarwidget--header {
251
+ background-color: var(~"--@{name}-100");
252
+ color: var(--fc-medium);
253
+ }
254
+
255
+ .s-sidebarwidget--header,
256
+ .s-sidebarwidget--content {
257
+ border-color: var(~"--@{name}-200");
258
+
259
+ .highcontrast-mode({
260
+ border-color: var(~"--@{name}-700");
261
+ });
262
+ }
263
+
264
+ &:after {
265
+ border-color: var(~"--@{name}-200");
266
+
267
+ .highcontrast-mode({
268
+ border-color: var(~"--@{name}-700");
269
+ });
270
+ }
271
+ }
272
+ }