@stackoverflow/stacks 1.0.0-beta.0 → 1.1.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 (74) hide show
  1. package/README.md +47 -47
  2. package/dist/controllers/s-popover.d.ts +11 -2
  3. package/dist/css/stacks.css +214 -3
  4. package/dist/css/stacks.min.css +1 -1
  5. package/dist/js/stacks.js +18 -2
  6. package/dist/js/stacks.min.js +1 -1
  7. package/lib/css/atomic/borders.less +378 -378
  8. package/lib/css/atomic/colors.less +209 -209
  9. package/lib/css/atomic/flex.less +375 -375
  10. package/lib/css/atomic/grid.less +174 -174
  11. package/lib/css/atomic/misc.less +343 -343
  12. package/lib/css/atomic/spacing.less +342 -314
  13. package/lib/css/atomic/typography.less +273 -273
  14. package/lib/css/atomic/width-height.less +194 -194
  15. package/lib/css/base/body.less +44 -44
  16. package/lib/css/base/configuration-static.less +61 -61
  17. package/lib/css/base/icons.less +20 -20
  18. package/lib/css/base/internals.less +220 -220
  19. package/lib/css/base/reset-meyer.less +64 -64
  20. package/lib/css/base/reset-normalize.less +449 -449
  21. package/lib/css/base/reset.less +20 -20
  22. package/lib/css/components/activity-indicator.less +44 -45
  23. package/lib/css/components/avatars.less +189 -189
  24. package/lib/css/components/badges.less +209 -209
  25. package/lib/css/components/banners.less +80 -80
  26. package/lib/css/components/blank-states.less +26 -26
  27. package/lib/css/components/breadcrumbs.less +44 -44
  28. package/lib/css/components/button-groups.less +104 -104
  29. package/lib/css/components/buttons.less +665 -665
  30. package/lib/css/components/cards.less +44 -44
  31. package/lib/css/components/code-blocks.less +130 -130
  32. package/lib/css/components/collapsible.less +104 -104
  33. package/lib/css/components/inputs.less +728 -728
  34. package/lib/css/components/link-previews.less +136 -136
  35. package/lib/css/components/links.less +218 -218
  36. package/lib/css/components/menu.less +47 -47
  37. package/lib/css/components/modals.less +133 -133
  38. package/lib/css/components/navigation.less +146 -146
  39. package/lib/css/components/notices.less +233 -233
  40. package/lib/css/components/page-titles.less +60 -60
  41. package/lib/css/components/pagination.less +55 -55
  42. package/lib/css/components/popovers.less +197 -197
  43. package/lib/css/components/post-summary.less +425 -425
  44. package/lib/css/components/progress-bars.less +330 -330
  45. package/lib/css/components/prose.less +503 -503
  46. package/lib/css/components/spinner.less +107 -107
  47. package/lib/css/components/tables.less +341 -341
  48. package/lib/css/components/tags.less +236 -236
  49. package/lib/css/components/toggle-switches.less +144 -144
  50. package/lib/css/components/topbar.less +427 -427
  51. package/lib/css/components/uploader.less +210 -210
  52. package/lib/css/components/user-cards.less +169 -169
  53. package/lib/css/components/widget-dynamic.less +33 -33
  54. package/lib/css/components/widget-static.less +273 -273
  55. package/lib/css/exports/constants-colors.less +1092 -1092
  56. package/lib/css/exports/constants-helpers.less +108 -108
  57. package/lib/css/exports/constants-type.less +153 -153
  58. package/lib/css/exports/exports.less +15 -15
  59. package/lib/css/exports/mixins.less +237 -237
  60. package/lib/css/stacks-dynamic.less +35 -35
  61. package/lib/css/stacks-static.less +86 -86
  62. package/lib/css/stacks.less +13 -13
  63. package/lib/ts/controllers/index.ts +7 -7
  64. package/lib/ts/controllers/s-expandable-control.ts +188 -188
  65. package/lib/ts/controllers/s-modal.ts +321 -321
  66. package/lib/ts/controllers/s-navigation-tablist.ts +117 -117
  67. package/lib/ts/controllers/s-popover.ts +567 -547
  68. package/lib/ts/controllers/s-table.ts +220 -220
  69. package/lib/ts/controllers/s-tooltip.ts +246 -246
  70. package/lib/ts/controllers/s-uploader.ts +172 -172
  71. package/lib/ts/index.ts +20 -20
  72. package/lib/ts/stacks.ts +88 -88
  73. package/lib/tsconfig.json +13 -13
  74. package/package.json +86 -87
@@ -1,273 +1,273 @@
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
- // widget-dynamic.less.
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
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
- position: relative; // so that it's the positioning parent for the :after
24
- border: 1px solid var(--s-sidebarwidget-outer-border-color);
25
- border-radius: var(--br-sm);
26
- box-shadow: var(--bs-sm);
27
- font-size: var(--fs-body1);
28
- background-color: var(--white);
29
-
30
- &:not(.s-anchors) a:not(.button):not(.s-btn):not(.post-tag):not(.s-sidebarwidget--action):not(.s-user-card--link) {
31
- &,
32
- &:visited {
33
- color: var(--black-500);
34
- }
35
- }
36
-
37
- // We must support things like collapsible (in particular invisble) elements, wrapper elements,
38
- // etc. Therefore every .-content and .-header must stand on its own; we cannot rely on things
39
- // like :first-child, because the *first* child may not be the first *visible* child, and it may
40
- // also be the :first-child of some wrapper. This is why every .-header and .-content has a
41
- // border-top. But because you shouldn't see the first visible item's or header's top border
42
- // (the widget itself provides for that border), we shift everything up by one pixel with the following pseudo-element.
43
- &:before {
44
- content: '';
45
- display: block;
46
- margin-top: -1px;
47
- }
48
-
49
- // However, because of the above, the top item's divider line now sits above the .s-sidebarwidget's top
50
- // border. We could fix this by using overflow: hidden, but that would constrain users of
51
- // .s-sidebarwidget to never have things like tooltips, autocompletes or the like that reach outside
52
- // the widget boundaries.
53
- // What we do instead is re-create the widget's top border in an absolutely positioned :after,
54
- // which sits above our item's top border. Technically, a tiny corner of the item's border will
55
- // still be visible, but at its highest point, this corner has a height of 0.27 pixels. And for
56
- // this sub-pixel issues, we're talking about different shades of gray. So we can live with that.
57
- &:after {
58
- content: '';
59
- position: absolute;
60
- top: -1px;
61
- right: -1px;
62
- left: -1px;
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
- 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 var(--s-sidebarwidget-outer-border-color);
76
- }
77
- }
78
- }
79
-
80
- .s-sidebarwidget--header,
81
- .s-sidebarwidget--content {
82
- border-top: 1px solid var(--s-sidebarwidget-content-separator-color);
83
-
84
- &:active {
85
- outline: none;
86
- }
87
- }
88
-
89
-
90
- .s-sidebarwidget--header {
91
- padding: var(--s-sidebarwidget-content-inner-spacing) var(--s-sidebarwidget-content-padding);
92
- background: var(--s-sidebarwidget-header-background-color);
93
- color: var(--black-600);
94
- font-size: var(--fs-body2);
95
- font-weight: normal;
96
-
97
- &:first-child {
98
- border-top-left-radius: var(--br-sm);
99
- border-top-right-radius: var(--br-sm);
100
- }
101
-
102
- &.s-sidebarwidget__small-bold-text {
103
- font-size: var(--fs-caption);
104
- font-weight: bold;
105
- .-action {
106
- font-weight: normal;
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
- }
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: var(--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 var(--su4) var(--su8);
135
- color: var(--blue);
136
- font-size: var(--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: 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
- border-collapse: separate;
143
- border-spacing: var(--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: var(--s-sidebarwidget-content-outer-spacing) var(--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: calc(var(--s-sidebarwidget-content-outer-spacing) - var(--s-sidebarwidget-content-inner-spacing)) var(--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: var(--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% + 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
- border-left-width: 3px;
195
- border-left-style: solid;
196
- // border-left-color is set in 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
-
207
- .s-sidebarwidget--subnav {
208
- list-style-type: none;
209
- padding-left: 0;
210
- margin-left: var(--su8);
211
-
212
- li {
213
- margin-top: 12px;
214
- padding-left: 16px;
215
- background-position: 0 calc((1.2em - 10px) / 2);
216
- background-repeat: no-repeat;
217
- background-size: auto 10px;
218
-
219
- #stacks-internals #bullet-arrow(var(--black-100));
220
-
221
- &[aria-current="true"],
222
- &[aria-current="page"] {
223
- // this is given a bullet-arrow in the primary color in widget-dynamic.less
224
- color: var(--black);
225
- font-weight: bold;
226
-
227
- a,
228
- a:visited { // TODO: see above
229
- color: inherit;
230
- }
231
- }
232
- }
233
- }
234
-
235
- // COLOR ALTERNATIVES
236
- // todo: use CSS custom properties for this once we don't care about IE anymore
237
-
238
- .alternate-color(blue);
239
- .alternate-color(yellow);
240
- .alternate-color(green);
241
-
242
- .alternate-color(@name) {
243
- &.s-sidebarwidget__@{name} {
244
- border-color: var(~"--@{name}-200");
245
- background-color: var(~"--@{name}-050");
246
-
247
- .highcontrast-mode({
248
- border-color: var(~"--@{name}-700");
249
- });
250
-
251
- .s-sidebarwidget--header {
252
- background-color: var(~"--@{name}-100");
253
- color: var(--fc-medium);
254
- }
255
-
256
- .s-sidebarwidget--header,
257
- .s-sidebarwidget--content {
258
- border-color: var(~"--@{name}-200");
259
-
260
- .highcontrast-mode({
261
- border-color: var(~"--@{name}-700");
262
- });
263
- }
264
-
265
- &:after {
266
- border-color: var(~"--@{name}-200");
267
-
268
- .highcontrast-mode({
269
- border-color: var(~"--@{name}-700");
270
- });
271
- }
272
- }
273
- }
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
+ // widget-dynamic.less.
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
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
+ position: relative; // so that it's the positioning parent for the :after
24
+ border: 1px solid var(--s-sidebarwidget-outer-border-color);
25
+ border-radius: var(--br-sm);
26
+ box-shadow: var(--bs-sm);
27
+ font-size: var(--fs-body1);
28
+ background-color: var(--white);
29
+
30
+ &:not(.s-anchors) a:not(.button):not(.s-btn):not(.post-tag):not(.s-sidebarwidget--action):not(.s-user-card--link) {
31
+ &,
32
+ &:visited {
33
+ color: var(--black-500);
34
+ }
35
+ }
36
+
37
+ // We must support things like collapsible (in particular invisble) elements, wrapper elements,
38
+ // etc. Therefore every .-content and .-header must stand on its own; we cannot rely on things
39
+ // like :first-child, because the *first* child may not be the first *visible* child, and it may
40
+ // also be the :first-child of some wrapper. This is why every .-header and .-content has a
41
+ // border-top. But because you shouldn't see the first visible item's or header's top border
42
+ // (the widget itself provides for that border), we shift everything up by one pixel with the following pseudo-element.
43
+ &:before {
44
+ content: '';
45
+ display: block;
46
+ margin-top: -1px;
47
+ }
48
+
49
+ // However, because of the above, the top item's divider line now sits above the .s-sidebarwidget's top
50
+ // border. We could fix this by using overflow: hidden, but that would constrain users of
51
+ // .s-sidebarwidget to never have things like tooltips, autocompletes or the like that reach outside
52
+ // the widget boundaries.
53
+ // What we do instead is re-create the widget's top border in an absolutely positioned :after,
54
+ // which sits above our item's top border. Technically, a tiny corner of the item's border will
55
+ // still be visible, but at its highest point, this corner has a height of 0.27 pixels. And for
56
+ // this sub-pixel issues, we're talking about different shades of gray. So we can live with that.
57
+ &:after {
58
+ content: '';
59
+ position: absolute;
60
+ top: -1px;
61
+ right: -1px;
62
+ left: -1px;
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
+ 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 var(--s-sidebarwidget-outer-border-color);
76
+ }
77
+ }
78
+ }
79
+
80
+ .s-sidebarwidget--header,
81
+ .s-sidebarwidget--content {
82
+ border-top: 1px solid var(--s-sidebarwidget-content-separator-color);
83
+
84
+ &:active {
85
+ outline: none;
86
+ }
87
+ }
88
+
89
+
90
+ .s-sidebarwidget--header {
91
+ padding: var(--s-sidebarwidget-content-inner-spacing) var(--s-sidebarwidget-content-padding);
92
+ background: var(--s-sidebarwidget-header-background-color);
93
+ color: var(--black-600);
94
+ font-size: var(--fs-body2);
95
+ font-weight: normal;
96
+
97
+ &:first-child {
98
+ border-top-left-radius: var(--br-sm);
99
+ border-top-right-radius: var(--br-sm);
100
+ }
101
+
102
+ &.s-sidebarwidget__small-bold-text {
103
+ font-size: var(--fs-caption);
104
+ font-weight: bold;
105
+ .-action {
106
+ font-weight: normal;
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
+ }
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: var(--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 var(--su4) var(--su8);
135
+ color: var(--blue);
136
+ font-size: var(--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: 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
+ border-collapse: separate;
143
+ border-spacing: var(--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: var(--s-sidebarwidget-content-outer-spacing) var(--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: calc(var(--s-sidebarwidget-content-outer-spacing) - var(--s-sidebarwidget-content-inner-spacing)) var(--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: var(--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% + 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
+ border-left-width: 3px;
195
+ border-left-style: solid;
196
+ // border-left-color is set in 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
+
207
+ .s-sidebarwidget--subnav {
208
+ list-style-type: none;
209
+ padding-left: 0;
210
+ margin-left: var(--su8);
211
+
212
+ li {
213
+ margin-top: 12px;
214
+ padding-left: 16px;
215
+ background-position: 0 calc((1.2em - 10px) / 2);
216
+ background-repeat: no-repeat;
217
+ background-size: auto 10px;
218
+
219
+ #stacks-internals #bullet-arrow(var(--black-100));
220
+
221
+ &[aria-current="true"],
222
+ &[aria-current="page"] {
223
+ // this is given a bullet-arrow in the primary color in widget-dynamic.less
224
+ color: var(--black);
225
+ font-weight: bold;
226
+
227
+ a,
228
+ a:visited { // TODO: see above
229
+ color: inherit;
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ // COLOR ALTERNATIVES
236
+ // todo: use CSS custom properties for this once we don't care about IE anymore
237
+
238
+ .alternate-color(blue);
239
+ .alternate-color(yellow);
240
+ .alternate-color(green);
241
+
242
+ .alternate-color(@name) {
243
+ &.s-sidebarwidget__@{name} {
244
+ border-color: var(~"--@{name}-200");
245
+ background-color: var(~"--@{name}-050");
246
+
247
+ .highcontrast-mode({
248
+ border-color: var(~"--@{name}-700");
249
+ });
250
+
251
+ .s-sidebarwidget--header {
252
+ background-color: var(~"--@{name}-100");
253
+ color: var(--fc-medium);
254
+ }
255
+
256
+ .s-sidebarwidget--header,
257
+ .s-sidebarwidget--content {
258
+ border-color: var(~"--@{name}-200");
259
+
260
+ .highcontrast-mode({
261
+ border-color: var(~"--@{name}-700");
262
+ });
263
+ }
264
+
265
+ &:after {
266
+ border-color: var(~"--@{name}-200");
267
+
268
+ .highcontrast-mode({
269
+ border-color: var(~"--@{name}-700");
270
+ });
271
+ }
272
+ }
273
+ }