@stackoverflow/stacks 2.7.3 → 2.7.4

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 (83) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +158 -180
  3. package/dist/css/stacks.css +6 -0
  4. package/dist/js/stacks.min.js +1 -1
  5. package/lib/atomic/border.less +139 -139
  6. package/lib/atomic/color.less +36 -36
  7. package/lib/atomic/flex.less +426 -426
  8. package/lib/atomic/gap.less +44 -44
  9. package/lib/atomic/grid.less +139 -139
  10. package/lib/atomic/misc.less +374 -374
  11. package/lib/atomic/spacing.less +98 -98
  12. package/lib/atomic/typography.less +266 -264
  13. package/lib/atomic/width-height.less +194 -194
  14. package/lib/base/body.less +44 -44
  15. package/lib/base/configuration-static.less +61 -61
  16. package/lib/base/fieldset.less +5 -5
  17. package/lib/base/icon.less +11 -11
  18. package/lib/base/internal.less +220 -220
  19. package/lib/base/reset-meyer.less +64 -64
  20. package/lib/base/reset-normalize.less +449 -449
  21. package/lib/base/reset.less +20 -20
  22. package/lib/components/activity-indicator/activity-indicator.less +53 -53
  23. package/lib/components/avatar/avatar.less +108 -108
  24. package/lib/components/award-bling/award-bling.less +31 -31
  25. package/lib/components/banner/banner.less +44 -44
  26. package/lib/components/banner/banner.ts +149 -149
  27. package/lib/components/block-link/block-link.less +82 -82
  28. package/lib/components/breadcrumbs/breadcrumbs.less +41 -41
  29. package/lib/components/button-group/button-group.less +82 -82
  30. package/lib/components/card/card.less +37 -37
  31. package/lib/components/check-control/check-control.less +17 -17
  32. package/lib/components/check-group/check-group.less +19 -19
  33. package/lib/components/checkbox_radio/checkbox_radio.less +159 -159
  34. package/lib/components/code-block/code-block.fixtures.ts +88 -88
  35. package/lib/components/code-block/code-block.less +116 -116
  36. package/lib/components/description/description.less +9 -9
  37. package/lib/components/empty-state/empty-state.less +16 -16
  38. package/lib/components/expandable/expandable.less +118 -118
  39. package/lib/components/input-fill/input-fill.less +35 -35
  40. package/lib/components/input-icon/input-icon.less +45 -45
  41. package/lib/components/input-message/input-message.less +49 -49
  42. package/lib/components/label/label.less +110 -110
  43. package/lib/components/link-preview/link-preview.less +148 -148
  44. package/lib/components/menu/menu.less +41 -41
  45. package/lib/components/modal/modal.less +118 -118
  46. package/lib/components/modal/modal.ts +383 -383
  47. package/lib/components/navigation/navigation.less +136 -136
  48. package/lib/components/navigation/navigation.ts +128 -128
  49. package/lib/components/page-title/page-title.less +51 -51
  50. package/lib/components/popover/popover.less +159 -159
  51. package/lib/components/popover/popover.ts +651 -651
  52. package/lib/components/post-summary/post-summary.less +457 -457
  53. package/lib/components/progress-bar/progress-bar.less +291 -291
  54. package/lib/components/prose/prose.less +452 -452
  55. package/lib/components/select/select.less +138 -138
  56. package/lib/components/spinner/spinner.less +103 -103
  57. package/lib/components/table/table.ts +296 -296
  58. package/lib/components/table-container/table-container.less +4 -4
  59. package/lib/components/tag/tag.less +186 -186
  60. package/lib/components/toast/toast.less +35 -35
  61. package/lib/components/toast/toast.ts +357 -357
  62. package/lib/components/toggle-switch/toggle-switch.less +104 -104
  63. package/lib/components/topbar/topbar.less +553 -553
  64. package/lib/components/uploader/uploader.less +205 -205
  65. package/lib/components/user-card/user-card.less +129 -129
  66. package/lib/controllers.ts +33 -33
  67. package/lib/exports/color-mixins.less +283 -283
  68. package/lib/exports/constants-helpers.less +108 -108
  69. package/lib/exports/constants-type.less +155 -155
  70. package/lib/exports/exports.less +15 -15
  71. package/lib/exports/mixins.less +334 -333
  72. package/lib/exports/spacing-mixins.less +67 -67
  73. package/lib/index.ts +32 -32
  74. package/lib/input-utils.less +41 -41
  75. package/lib/stacks-dynamic.less +24 -24
  76. package/lib/stacks-static.less +93 -93
  77. package/lib/stacks.less +13 -13
  78. package/lib/test/assertions.ts +36 -36
  79. package/lib/test/less-test-utils.ts +28 -28
  80. package/lib/test/open-wc-testing-patch.d.ts +26 -26
  81. package/lib/tsconfig.build.json +4 -4
  82. package/lib/tsconfig.json +17 -17
  83. package/package.json +26 -22
@@ -1,553 +1,553 @@
1
- .s-topbar {
2
- --_tb-bt: var(--theme-topbar-accent-border, 3px solid var(--theme-primary));
3
- --_tb-h: var(--theme-topbar-height, calc(var(--su-static48) + var(--su-static8)));
4
- // CHILD COMPONENT CUSTOM PROPERTIES
5
- // Item
6
- --_tb-item-bg: unset;
7
- --_tb-item-fc: var(--theme-topbar-item-color, var(--black-400));
8
- // Item s-activity-indicator
9
- --_tb-item-ai-bs: 0 0 0 var(--su-static2) var(--theme-topbar-background-color, var(--white));
10
- --_tb-item-ai-t: calc(50% - calc(var(--su12) + var(--su2))); // 50% - 14px;
11
- // Logo
12
- --_tb-logo-bg: transparent;
13
- // Menu btn
14
- --_tb-menu-btn-bg: unset;
15
- --_tb-menu-btn-bg-hover: unset;
16
- --_tb-menu-btn-fc-hover: unset;
17
- --_tb-menu-btn-span-bg: var(--theme-topbar-item-color, var(--black-400));
18
- --_tb-menu-btn-span-fc: unset;
19
- --_tb-menu-btn-span-after-t: calc(var(--su-static6) - var(--su-static1)); // 5px;
20
- --_tb-menu-btn-span-after-rotate: 0deg;
21
- --_tb-menu-btn-span-before-t: calc(var(--su-static1) - var(--su-static6)); // -5px;
22
- --_tb-menu-btn-span-before-rotate: 0deg;
23
- // Notice
24
- --_tb-notice-bg: transparent;
25
- --_tb-notice-fc: var(--theme-topbar-item-color, var(--black-400));
26
- --_tb-notice-bg-hover: var(--theme-topbar-item-background-hover, var(--black-200));
27
- --_tb-notice-fc-hover: var(--theme-topbar-item-color-hover, var(--black-600));
28
- --_tb-notice-td: none;
29
- // Searchbar
30
- --_tb-searchbar-d: flex;
31
- --_tb-searchbar-p: 0 var(--su8);
32
- --_tb-searchbar-open-d: unset;
33
- --_tb-searchbar-open-mxw: 0;
34
- --_tb-searchbar-popover-wmn: calc(var(--s-step) * 4);
35
- --_tb-searchbar-popover-content-mxh: calc(100vh - var(--_tb-h) - var(--su16));
36
-
37
- // CONTEXTUAL STYLES
38
- .dark-mode({
39
- &.s-topbar__light {
40
- --focus-theme: var(--theme-dark-secondary-custom-200, .set-theme-secondary-default()[200]);
41
- }
42
- });
43
-
44
- .highcontrast-mode({
45
- --_tb-notice-td: underline;
46
-
47
- &.s-topbar__dark {
48
- --focus-theme: .theme-dark-default()[secondary];
49
- }
50
-
51
- &__dark {
52
- // TODO HACK remove everything below once light/dark topbars are inheriting forced themes correctly
53
- --theme-topbar-item-color: var(--_white-static);
54
- --theme-topbar-item-color-hover: var(--_white-static);
55
- --theme-topbar-item-background-hover: .set-black()[500];
56
- --theme-topbar-item-color-current: var(--_white-static);
57
-
58
- .s-badge {
59
- border-color: currentColor;
60
- }
61
- }
62
-
63
- &__light {
64
- // TODO HACK remove everything below once light/dark topbars are inheriting forced themes correctly
65
- --theme-topbar-item-color: .set-black()[600];
66
- --theme-topbar-item-color-hover: .set-black()[600]; // TODO hover is now identical color to base color
67
- --theme-topbar-item-background-hover: .set-black()[200];
68
- --theme-topbar-item-color-current: var(--_black-static);
69
- }
70
-
71
- // Search input
72
- --theme-topbar-search-color: var(--theme-topbar-item-color, var(--black-400));
73
- --theme-topbar-search-background: var(--theme-topbar-background-color, var(--white));
74
- --theme-topbar-search-placeholder: var(--theme-topbar-item-color, var(--black-400));
75
- --theme-topbar-search-border: var(--theme-topbar-item-color, var(--black-400));
76
-
77
- // Search switcher
78
- --theme-topbar-select-color: var(--theme-topbar-item-color, var(--black-400));
79
- --theme-topbar-select-background: var(--theme-topbar-background-color, var(--white));
80
-
81
- // Topbar items
82
- --theme-topbar-item-color: var(--black-600);
83
- --theme-topbar-item-color-hover: var(--black-600);
84
- --theme-topbar-item-background-hover: var(--black-300);
85
- --theme-topbar-item-color-current: var(--black);
86
-
87
- border-bottom: var(--su-static1) solid currentColor;
88
- });
89
-
90
- .highcontrast-dark-mode({
91
- &.s-topbar__light {
92
- --focus-theme: .set-theme-secondary-default()[200];
93
- }
94
- });
95
-
96
- #stacks-internals #screen-sm({
97
- --_tb-searchbar-d: none;
98
- --_tb-searchbar-p: var(--su8) var(--su12);
99
- --_tb-searchbar-open-d: flex;
100
- --_tb-searchbar-open-mxw: none;
101
- --_tb-searchbar-select-w: 25%;
102
- --_tb-searchbar-popover-wmn: initial;
103
- --_tb-searchbar-popover-content-mxh: calc(100vh - var(--_tb-h) - var(--su48) - var(--su12));
104
- });
105
-
106
- // VARIANTS
107
- // Overrides for focus style colors in forced light variant
108
- &&__light {
109
- --focus-neutral: .set-white()[default]; // forces white for inner focus ring color
110
- }
111
-
112
- &&__dark {
113
- --focus-neutral: .set-black()[600]; // set to match .s-topbar__dark --theme-topbar-background-color;
114
- --focus-theme: var(--theme-dark-secondary-custom-400, .theme-dark-default()[secondary]);
115
- }
116
-
117
- // CHILD ELEMENTS
118
- &:has(> &--skip-link:focus) {
119
- .s-topbar {
120
- &--container {
121
- height: var(--_tb-h);
122
- }
123
- &--skip-link {
124
- border-bottom: var(--_tb-bt);
125
- }
126
- }
127
-
128
- border-top: none;
129
- display: block;
130
- height: auto;
131
- }
132
-
133
- & a&--logo {
134
- &:focus-visible {
135
- .focus-styles(true);
136
- }
137
-
138
- &:hover,
139
- &.is-selected {
140
- --_tb-logo-bg: var(--theme-topbar-item-background-hover, var(--black-200));
141
- }
142
- }
143
-
144
- & &--container {
145
- align-items: center;
146
- display: flex;
147
- height: 100%;
148
- margin: 0 auto;
149
- max-width: 100%;
150
- width: var(--s-full);
151
- }
152
-
153
- & &--content {
154
- & > li {
155
- display: inline-flex;
156
- }
157
-
158
- .list-reset;
159
- @scrollbar-styles();// TODO remove once all topbars include necessary nav.s-topbar--navigation wrapper elements
160
- display: flex;
161
- height: 100%;
162
- margin-left: auto;// TODO remove once all topbars include necessary nav.s-topbar--navigation wrapper elements
163
- overflow-x: auto;// TODO remove once all topbars include necessary nav.s-topbar--navigation wrapper elements
164
- }
165
-
166
- & &--item {
167
- &:not(.s-topbar--item__unset) {
168
- .svg-icon {
169
- vertical-align: text-top;
170
- }
171
-
172
- &:focus-visible {
173
- .focus-styles(true);
174
- }
175
-
176
- &:hover,
177
- &.is-selected,
178
- &.is-selected:hover {
179
- --_tb-item-bg: var(--theme-topbar-item-background-hover, var(--black-200));
180
- --_tb-item-fc: var(--theme-topbar-item-color-hover, var(--black-600));
181
-
182
- --_tb-item-ai-bs: 0 0 0 var(--su-static2) var(--theme-topbar-item-background-hover, var(--black-200));
183
- --_tb-item-ai-t: calc(50% - calc(var(--su16) + var(--su2))); // 50% - 18px
184
-
185
- outline: none;
186
- }
187
-
188
- .s-activity-indicator {
189
- box-shadow: var(--_tb-item-ai-bs);
190
- top: var(--_tb-item-ai-t);
191
-
192
- position: absolute;
193
- right: var(--su-static2);
194
- transition: top var(--te-smooth) 0.15s;
195
- }
196
-
197
- background-color: var(--_tb-item-bg);
198
- color: var(--_tb-item-fc);
199
-
200
- align-items: center;
201
- border-radius: var(--br-sm);
202
- display: inline-flex;
203
- padding: 0 calc(var(--su12) - var(--su2));
204
- position: relative;
205
- text-decoration: none;
206
- white-space: nowrap;
207
- }
208
-
209
- &.s-topbar--item__unset { // provide only layout styling for unset items
210
- align-self: center;
211
- padding-top: var(--su8);
212
- padding-bottom: var(--su8);
213
- }
214
- }
215
-
216
- & &--logo {
217
- background-color: var(--_tb-logo-bg);
218
-
219
- align-items: center;
220
- border-radius: var(--br-sm);
221
- display: flex;
222
- height: 100%;
223
- padding: 0 var(--su8);
224
- }
225
-
226
- & &--menu-btn {
227
- &.is-selected { // Transforming hamburger into x
228
- --_tb-menu-btn-bg: var(--theme-topbar-item-background-current);
229
- --_tb-menu-btn-bg-hover: var(--theme-topbar-item-background-hover, var(--black-200));
230
- --_tb-menu-btn-fc: var(--theme-topbar-item-color-current, var(--black));
231
- --_tb-menu-btn-fc-hover: var(--theme-topbar-item-color-hover, var(--black-400));
232
- --_tb-menu-btn-span-bg: transparent;
233
- --_tb-menu-btn-span-after-t: 0;
234
- --_tb-menu-btn-span-after-rotate: 45deg;
235
- --_tb-menu-btn-span-before-t: 0;
236
- --_tb-menu-btn-span-before-rotate: -45deg;
237
- }
238
-
239
- &:not(.is-selected) {
240
- span {
241
- transition: background-color;
242
- transition-duration: 0.1s;
243
- }
244
- }
245
-
246
- span { // hamburger icon
247
- &,
248
- &:after,
249
- &:before {
250
- height: var(--su-static2);
251
- position: relative;
252
- width: var(--su-static16);
253
- }
254
-
255
- &:after,
256
- &:before {
257
- background-color: var(--theme-topbar-item-color, var(--black-400));
258
- content: '';
259
- left: 0;
260
- position: absolute;
261
- transition: top, transform; // `transition` needs to come before duration, timing
262
- transition-duration: 0.1s;
263
- transition-timing-function: ease-in-out;
264
- }
265
-
266
- &:after {
267
- top: var(--_tb-menu-btn-span-after-t);
268
- transform: rotate(var(--_tb-menu-btn-span-after-rotate));
269
- }
270
-
271
- &:before {
272
- top: var(--_tb-menu-btn-span-before-t);
273
- transform: rotate(var(--_tb-menu-btn-span-before-rotate));
274
- }
275
-
276
- background-color: var(--_tb-menu-btn-span-bg);
277
- }
278
-
279
- &:hover {
280
- background-color: var(--_tb-menu-btn-bg-hover);
281
- color: var(--_tb-menu-btn-fc-hover);
282
- }
283
-
284
- background-color: var(--_tb-menu-btn-bg);
285
- color: var(--_tb-menu-btn-fc);
286
-
287
- align-items: center;
288
- display: flex;
289
- flex-shrink: 0;
290
- height: 100%;
291
- justify-content: center;
292
- padding: 0 var(--su16);
293
- }
294
-
295
- & &--navigation {
296
- @scrollbar-styles();
297
- display: flex;
298
- height: 100%;
299
- margin-left: auto;
300
- overflow-x: auto;
301
- }
302
-
303
- & &--notice {
304
- &.is-unread {
305
- --_tb-notice-bg: var(--theme-primary-400);
306
- --_tb-notice-fc: var(--white);
307
- --_tb-notice-bg-hover: var(--theme-primary-500);
308
- --_tb-notice-fc-hover: var(--white);
309
- }
310
-
311
- &:focus-visible {
312
- .focus-styles(true, true);
313
- }
314
-
315
- &:hover {
316
- background-color: var(--_tb-notice-bg-hover);
317
- border-color: var(--_tb-notice-bg-hover); // notice border-color matches background-color
318
- color: var(--_tb-notice-fc-hover);
319
- }
320
-
321
- background-color: var(--_tb-notice-bg);
322
- border: var(--su-static1) solid var(--_tb-notice-bg); // notice border-color matches background-color
323
- color: var(--_tb-notice-fc);
324
- text-decoration: var(--_tb-notice-td);
325
-
326
- border-radius: var(--br-sm);
327
- display: inline-flex;
328
- flex-shrink: 0;
329
- font-size: var(--fs-fine);
330
- font-weight: 700;
331
- margin-left: var(--su8);
332
- margin-right: var(--su8);
333
- line-height: var(--lh-xxl);
334
- padding: 0 var(--su6);
335
- text-transform: uppercase;
336
- }
337
-
338
- & &--searchbar {
339
- #stacks-internals #screen-sm({
340
- background: var(--theme-topbar-item-background-hover, var(--black-200));
341
- left: 0;
342
- max-width: 100%;
343
- position: absolute;
344
- right: 0;
345
- top: 100%;
346
- });
347
-
348
- .s-topbar--searchbar--input-group {
349
- .s-input {
350
- &::placeholder {
351
- color: var(--theme-topbar-search-placeholder, var(--black-400));
352
- font-style: normal;
353
- }
354
-
355
- &:not(:focus-visible):not(.focus) {
356
- box-shadow: var(--theme-topbar-search-shadow);
357
- }
358
-
359
- background-color: var(--theme-topbar-search-background, var(--white));
360
- border-color: var(--theme-topbar-search-border, var(--black-300));
361
- color: var(--theme-topbar-search-color, var(--black-500));
362
- display: block;
363
- line-height: var(--lh-sm);
364
- }
365
-
366
- .s-input-icon {
367
- color: var(--theme-topbar-search-placeholder, var(--black-400));
368
- }
369
-
370
- flex-grow: 1;
371
- position: relative;
372
- }
373
-
374
- .s-popover {
375
- max-width: 100%;
376
- min-width: var(--_tb-searchbar-popover-wmn);
377
- padding: 0;
378
-
379
- .s-popover--content {
380
- max-height: var(--_tb-searchbar-popover-content-mxh);
381
- }
382
- }
383
-
384
- .s-select {
385
- #stacks-internals #screen-sm({
386
- width: 25% !important;
387
- });
388
-
389
- > select {
390
- &:focus-visible,
391
- &.focus {
392
- z-index: var(--zi-selected);
393
- }
394
-
395
- background-color: var(--theme-topbar-select-background, var(--black-200));
396
- border-bottom-right-radius: 0 !important;
397
- border-color: var(--theme-topbar-search-border, var(--black-300));
398
- border-top-right-radius: 0 !important;
399
- color: var(--theme-topbar-select-color, var(--black-500));
400
- height: 100%;
401
- line-height: var(--lh-sm);
402
- }
403
-
404
- + .s-topbar--searchbar--input-group > .s-input {
405
- border-bottom-left-radius: 0 !important;
406
- border-top-left-radius: 0 !important;
407
- }
408
-
409
- &:before,
410
- &:after {
411
- z-index: var(--zi-active); // Make sure our focus ring is above the search input
412
- }
413
-
414
- align-self: stretch;
415
- color: var(--theme-topbar-select-color, var(--black-500));
416
- margin-right: calc(var(--su-static1) * -1); //-1px
417
- max-width: calc(var(--s-step) * 2) !important; // wmx2;
418
- }
419
-
420
- &.s-topbar--searchbar__open {
421
- #stacks-internals #screen-sm({
422
- display: var(--_tb-searchbar-open-d);
423
- max-width: var(--_tb-searchbar-open-mxw);
424
- });
425
- }
426
-
427
- display: var(--_tb-searchbar-d);
428
-
429
- align-items: center;
430
- flex-grow: 1; // Allow the searchbar to grow if there *is* extra space
431
- flex-shrink: 10000; // Force the searchbar to shrink as much as possible if there's no extra space
432
- padding: var(--_tb-searchbar-p);
433
- }
434
-
435
- & &--skip-link {
436
- &:not(:focus) {
437
- &:extend(.v-visible-sr);
438
- }
439
-
440
- background-color: var(--theme-secondary-100);
441
- border-bottom: var(--_tb-bt);
442
- display: block;
443
- outline: none;
444
- padding: var(--su12);
445
- text-align: center;
446
- }
447
-
448
-
449
- .s-navigation {
450
- .s-navigation--item {
451
- &:not(.is-selected) {
452
- &:hover {
453
- background-color: var(--theme-topbar-item-background-hover, var(--black-200));
454
- color: var(--theme-topbar-item-color-hover, var(--black-400));
455
- }
456
-
457
- color: var(--theme-topbar-item-color, var(--black-400));
458
- }
459
- }
460
- }
461
-
462
- .s-popover .s-navigation {
463
- .s-navigation--item {
464
- &:not(.is-selected) {
465
- &:hover {
466
- background-color: var(--black-200);
467
- color: var(--black-600);
468
- }
469
-
470
- color: var(--black-500);
471
- }
472
- }
473
- }
474
-
475
- align-items: center;
476
- background-color: var(--theme-topbar-background-color, var(--white));
477
- border-bottom: var(--theme-topbar-bottom-border, var(--su-static1) solid var(--black-225));
478
- border-top: var(--_tb-bt);
479
- display: flex;
480
- height: var(--_tb-h);
481
- min-width: auto;
482
- position: relative;
483
- width: 100%;
484
- z-index: var(--zi-navigation-fixed);
485
- }
486
-
487
- // DARK/LIGHT VARIANTS
488
- // NOTE: These are declared outside of the .s-topbar block to allow consumers (Core) to reference them directly
489
- // TODO move within .s-topbar block once Core no longer references this directly
490
- .s-topbar__dark {
491
- // TODO this only works 100% perfectly in dark mode, due to child elements inheriting current theme colors
492
- // TODO extend forced dark mode instead of overriding
493
- @topbar-actual-background: .set-black()[600];
494
-
495
- #calc-topbar-lightness-increase() when (lightness(@topbar-actual-background) < 15%) {
496
- @topbar-search-lightness-increase: 20%;
497
- }
498
- #calc-topbar-lightness-increase() when not (lightness(@topbar-actual-background) < 15%) {
499
- @topbar-search-lightness-increase: 10%;
500
- }
501
- #calc-topbar-lightness-increase();
502
-
503
- --theme-topbar-background-color: @topbar-actual-background;
504
- --theme-topbar-bottom-border: var(--su-static1) solid @topbar-actual-background;
505
-
506
- // Search input
507
- --theme-topbar-search-color: lighten(@topbar-actual-background, 80% + @topbar-search-lightness-increase);
508
- --theme-topbar-search-background: lighten(@topbar-actual-background, @topbar-search-lightness-increase);
509
- --theme-topbar-search-placeholder: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
510
- --theme-topbar-search-border: lighten(@topbar-actual-background, 20% + @topbar-search-lightness-increase);
511
-
512
- // Search switcher
513
- --theme-topbar-select-color: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
514
- --theme-topbar-select-background: lighten(@topbar-actual-background, 10% + @topbar-search-lightness-increase);
515
-
516
- // Items
517
- --theme-topbar-item-color: .set-black()[225];
518
- --theme-topbar-item-color-hover: var(--_white-static);
519
- --theme-topbar-item-background-hover: .set-black()[500];
520
- --theme-topbar-item-color-current: var(--_white-static);
521
-
522
- // Themed border accent
523
- --theme-topbar-accent-border: none;
524
-
525
- --scrollbar: hsla(0, 0%, 100%, 0.2);
526
- }
527
-
528
- // TODO move within .s-topbar block once Core no longer references this directly
529
- .s-topbar__light {
530
- // TODO this only works 100% perfectly in light mode, due to child elements inheriting current theme colors
531
- // TODO extend forced light mode instead of overriding
532
-
533
- --theme-topbar-background-color: var(--_white-static);
534
- --theme-topbar-bottom-border: var(--su-static1) solid .set-black()[225];
535
-
536
- // Search input
537
- --theme-topbar-search-color: .set-black()[500];
538
- --theme-topbar-search-background: var(--_white-static);
539
- --theme-topbar-search-placeholder: .set-black()[400];
540
- --theme-topbar-search-border: .set-black()[300];
541
-
542
- // Search switcher
543
- --theme-topbar-select-color: .set-black()[500];
544
- --theme-topbar-select-background: .set-black()[200];
545
-
546
- // Items
547
- --theme-topbar-item-color: .set-black()[400];
548
- --theme-topbar-item-color-hover: .set-black()[500];
549
- --theme-topbar-item-background-hover: .set-black()[200];
550
- --theme-topbar-item-color-current: var(--_black-static);
551
-
552
- --scrollbar: hsla(0, 0%, 0%, 0.2);
553
- }
1
+ .s-topbar {
2
+ --_tb-bt: var(--theme-topbar-accent-border, 3px solid var(--theme-primary));
3
+ --_tb-h: var(--theme-topbar-height, calc(var(--su-static48) + var(--su-static8)));
4
+ // CHILD COMPONENT CUSTOM PROPERTIES
5
+ // Item
6
+ --_tb-item-bg: unset;
7
+ --_tb-item-fc: var(--theme-topbar-item-color, var(--black-400));
8
+ // Item s-activity-indicator
9
+ --_tb-item-ai-bs: 0 0 0 var(--su-static2) var(--theme-topbar-background-color, var(--white));
10
+ --_tb-item-ai-t: calc(50% - calc(var(--su12) + var(--su2))); // 50% - 14px;
11
+ // Logo
12
+ --_tb-logo-bg: transparent;
13
+ // Menu btn
14
+ --_tb-menu-btn-bg: unset;
15
+ --_tb-menu-btn-bg-hover: unset;
16
+ --_tb-menu-btn-fc-hover: unset;
17
+ --_tb-menu-btn-span-bg: var(--theme-topbar-item-color, var(--black-400));
18
+ --_tb-menu-btn-span-fc: unset;
19
+ --_tb-menu-btn-span-after-t: calc(var(--su-static6) - var(--su-static1)); // 5px;
20
+ --_tb-menu-btn-span-after-rotate: 0deg;
21
+ --_tb-menu-btn-span-before-t: calc(var(--su-static1) - var(--su-static6)); // -5px;
22
+ --_tb-menu-btn-span-before-rotate: 0deg;
23
+ // Notice
24
+ --_tb-notice-bg: transparent;
25
+ --_tb-notice-fc: var(--theme-topbar-item-color, var(--black-400));
26
+ --_tb-notice-bg-hover: var(--theme-topbar-item-background-hover, var(--black-200));
27
+ --_tb-notice-fc-hover: var(--theme-topbar-item-color-hover, var(--black-600));
28
+ --_tb-notice-td: none;
29
+ // Searchbar
30
+ --_tb-searchbar-d: flex;
31
+ --_tb-searchbar-p: 0 var(--su8);
32
+ --_tb-searchbar-open-d: unset;
33
+ --_tb-searchbar-open-mxw: 0;
34
+ --_tb-searchbar-popover-wmn: calc(var(--s-step) * 4);
35
+ --_tb-searchbar-popover-content-mxh: calc(100vh - var(--_tb-h) - var(--su16));
36
+
37
+ // CONTEXTUAL STYLES
38
+ .dark-mode({
39
+ &.s-topbar__light {
40
+ --focus-theme: var(--theme-dark-secondary-custom-200, .set-theme-secondary-default()[200]);
41
+ }
42
+ });
43
+
44
+ .highcontrast-mode({
45
+ --_tb-notice-td: underline;
46
+
47
+ &.s-topbar__dark {
48
+ --focus-theme: .theme-dark-default()[secondary];
49
+ }
50
+
51
+ &__dark {
52
+ // TODO HACK remove everything below once light/dark topbars are inheriting forced themes correctly
53
+ --theme-topbar-item-color: var(--_white-static);
54
+ --theme-topbar-item-color-hover: var(--_white-static);
55
+ --theme-topbar-item-background-hover: .set-black()[500];
56
+ --theme-topbar-item-color-current: var(--_white-static);
57
+
58
+ .s-badge {
59
+ border-color: currentColor;
60
+ }
61
+ }
62
+
63
+ &__light {
64
+ // TODO HACK remove everything below once light/dark topbars are inheriting forced themes correctly
65
+ --theme-topbar-item-color: .set-black()[600];
66
+ --theme-topbar-item-color-hover: .set-black()[600]; // TODO hover is now identical color to base color
67
+ --theme-topbar-item-background-hover: .set-black()[200];
68
+ --theme-topbar-item-color-current: var(--_black-static);
69
+ }
70
+
71
+ // Search input
72
+ --theme-topbar-search-color: var(--theme-topbar-item-color, var(--black-400));
73
+ --theme-topbar-search-background: var(--theme-topbar-background-color, var(--white));
74
+ --theme-topbar-search-placeholder: var(--theme-topbar-item-color, var(--black-400));
75
+ --theme-topbar-search-border: var(--theme-topbar-item-color, var(--black-400));
76
+
77
+ // Search switcher
78
+ --theme-topbar-select-color: var(--theme-topbar-item-color, var(--black-400));
79
+ --theme-topbar-select-background: var(--theme-topbar-background-color, var(--white));
80
+
81
+ // Topbar items
82
+ --theme-topbar-item-color: var(--black-600);
83
+ --theme-topbar-item-color-hover: var(--black-600);
84
+ --theme-topbar-item-background-hover: var(--black-300);
85
+ --theme-topbar-item-color-current: var(--black);
86
+
87
+ border-bottom: var(--su-static1) solid currentColor;
88
+ });
89
+
90
+ .highcontrast-dark-mode({
91
+ &.s-topbar__light {
92
+ --focus-theme: .set-theme-secondary-default()[200];
93
+ }
94
+ });
95
+
96
+ #stacks-internals #screen-sm({
97
+ --_tb-searchbar-d: none;
98
+ --_tb-searchbar-p: var(--su8) var(--su12);
99
+ --_tb-searchbar-open-d: flex;
100
+ --_tb-searchbar-open-mxw: none;
101
+ --_tb-searchbar-select-w: 25%;
102
+ --_tb-searchbar-popover-wmn: initial;
103
+ --_tb-searchbar-popover-content-mxh: calc(100vh - var(--_tb-h) - var(--su48) - var(--su12));
104
+ });
105
+
106
+ // VARIANTS
107
+ // Overrides for focus style colors in forced light variant
108
+ &&__light {
109
+ --focus-neutral: .set-white()[default]; // forces white for inner focus ring color
110
+ }
111
+
112
+ &&__dark {
113
+ --focus-neutral: .set-black()[600]; // set to match .s-topbar__dark --theme-topbar-background-color;
114
+ --focus-theme: var(--theme-dark-secondary-custom-400, .theme-dark-default()[secondary]);
115
+ }
116
+
117
+ // CHILD ELEMENTS
118
+ &:has(> &--skip-link:focus) {
119
+ .s-topbar {
120
+ &--container {
121
+ height: var(--_tb-h);
122
+ }
123
+ &--skip-link {
124
+ border-bottom: var(--_tb-bt);
125
+ }
126
+ }
127
+
128
+ border-top: none;
129
+ display: block;
130
+ height: auto;
131
+ }
132
+
133
+ & a&--logo {
134
+ &:focus-visible {
135
+ .focus-styles(true);
136
+ }
137
+
138
+ &:hover,
139
+ &.is-selected {
140
+ --_tb-logo-bg: var(--theme-topbar-item-background-hover, var(--black-200));
141
+ }
142
+ }
143
+
144
+ & &--container {
145
+ align-items: center;
146
+ display: flex;
147
+ height: 100%;
148
+ margin: 0 auto;
149
+ max-width: 100%;
150
+ width: var(--s-full);
151
+ }
152
+
153
+ & &--content {
154
+ & > li {
155
+ display: inline-flex;
156
+ }
157
+
158
+ .list-reset;
159
+ @scrollbar-styles();// TODO remove once all topbars include necessary nav.s-topbar--navigation wrapper elements
160
+ display: flex;
161
+ height: 100%;
162
+ margin-left: auto;// TODO remove once all topbars include necessary nav.s-topbar--navigation wrapper elements
163
+ overflow-x: auto;// TODO remove once all topbars include necessary nav.s-topbar--navigation wrapper elements
164
+ }
165
+
166
+ & &--item {
167
+ &:not(.s-topbar--item__unset) {
168
+ .svg-icon {
169
+ vertical-align: text-top;
170
+ }
171
+
172
+ &:focus-visible {
173
+ .focus-styles(true);
174
+ }
175
+
176
+ &:hover,
177
+ &.is-selected,
178
+ &.is-selected:hover {
179
+ --_tb-item-bg: var(--theme-topbar-item-background-hover, var(--black-200));
180
+ --_tb-item-fc: var(--theme-topbar-item-color-hover, var(--black-600));
181
+
182
+ --_tb-item-ai-bs: 0 0 0 var(--su-static2) var(--theme-topbar-item-background-hover, var(--black-200));
183
+ --_tb-item-ai-t: calc(50% - calc(var(--su16) + var(--su2))); // 50% - 18px
184
+
185
+ outline: none;
186
+ }
187
+
188
+ .s-activity-indicator {
189
+ box-shadow: var(--_tb-item-ai-bs);
190
+ top: var(--_tb-item-ai-t);
191
+
192
+ position: absolute;
193
+ right: var(--su-static2);
194
+ transition: top var(--te-smooth) 0.15s;
195
+ }
196
+
197
+ background-color: var(--_tb-item-bg);
198
+ color: var(--_tb-item-fc);
199
+
200
+ align-items: center;
201
+ border-radius: var(--br-sm);
202
+ display: inline-flex;
203
+ padding: 0 calc(var(--su12) - var(--su2));
204
+ position: relative;
205
+ text-decoration: none;
206
+ white-space: nowrap;
207
+ }
208
+
209
+ &.s-topbar--item__unset { // provide only layout styling for unset items
210
+ align-self: center;
211
+ padding-top: var(--su8);
212
+ padding-bottom: var(--su8);
213
+ }
214
+ }
215
+
216
+ & &--logo {
217
+ background-color: var(--_tb-logo-bg);
218
+
219
+ align-items: center;
220
+ border-radius: var(--br-sm);
221
+ display: flex;
222
+ height: 100%;
223
+ padding: 0 var(--su8);
224
+ }
225
+
226
+ & &--menu-btn {
227
+ &.is-selected { // Transforming hamburger into x
228
+ --_tb-menu-btn-bg: var(--theme-topbar-item-background-current);
229
+ --_tb-menu-btn-bg-hover: var(--theme-topbar-item-background-hover, var(--black-200));
230
+ --_tb-menu-btn-fc: var(--theme-topbar-item-color-current, var(--black));
231
+ --_tb-menu-btn-fc-hover: var(--theme-topbar-item-color-hover, var(--black-400));
232
+ --_tb-menu-btn-span-bg: transparent;
233
+ --_tb-menu-btn-span-after-t: 0;
234
+ --_tb-menu-btn-span-after-rotate: 45deg;
235
+ --_tb-menu-btn-span-before-t: 0;
236
+ --_tb-menu-btn-span-before-rotate: -45deg;
237
+ }
238
+
239
+ &:not(.is-selected) {
240
+ span {
241
+ transition: background-color;
242
+ transition-duration: 0.1s;
243
+ }
244
+ }
245
+
246
+ span { // hamburger icon
247
+ &,
248
+ &:after,
249
+ &:before {
250
+ height: var(--su-static2);
251
+ position: relative;
252
+ width: var(--su-static16);
253
+ }
254
+
255
+ &:after,
256
+ &:before {
257
+ background-color: var(--theme-topbar-item-color, var(--black-400));
258
+ content: '';
259
+ left: 0;
260
+ position: absolute;
261
+ transition: top, transform; // `transition` needs to come before duration, timing
262
+ transition-duration: 0.1s;
263
+ transition-timing-function: ease-in-out;
264
+ }
265
+
266
+ &:after {
267
+ top: var(--_tb-menu-btn-span-after-t);
268
+ transform: rotate(var(--_tb-menu-btn-span-after-rotate));
269
+ }
270
+
271
+ &:before {
272
+ top: var(--_tb-menu-btn-span-before-t);
273
+ transform: rotate(var(--_tb-menu-btn-span-before-rotate));
274
+ }
275
+
276
+ background-color: var(--_tb-menu-btn-span-bg);
277
+ }
278
+
279
+ &:hover {
280
+ background-color: var(--_tb-menu-btn-bg-hover);
281
+ color: var(--_tb-menu-btn-fc-hover);
282
+ }
283
+
284
+ background-color: var(--_tb-menu-btn-bg);
285
+ color: var(--_tb-menu-btn-fc);
286
+
287
+ align-items: center;
288
+ display: flex;
289
+ flex-shrink: 0;
290
+ height: 100%;
291
+ justify-content: center;
292
+ padding: 0 var(--su16);
293
+ }
294
+
295
+ & &--navigation {
296
+ @scrollbar-styles();
297
+ display: flex;
298
+ height: 100%;
299
+ margin-left: auto;
300
+ overflow-x: auto;
301
+ }
302
+
303
+ & &--notice {
304
+ &.is-unread {
305
+ --_tb-notice-bg: var(--theme-primary-400);
306
+ --_tb-notice-fc: var(--white);
307
+ --_tb-notice-bg-hover: var(--theme-primary-500);
308
+ --_tb-notice-fc-hover: var(--white);
309
+ }
310
+
311
+ &:focus-visible {
312
+ .focus-styles(true, true);
313
+ }
314
+
315
+ &:hover {
316
+ background-color: var(--_tb-notice-bg-hover);
317
+ border-color: var(--_tb-notice-bg-hover); // notice border-color matches background-color
318
+ color: var(--_tb-notice-fc-hover);
319
+ }
320
+
321
+ background-color: var(--_tb-notice-bg);
322
+ border: var(--su-static1) solid var(--_tb-notice-bg); // notice border-color matches background-color
323
+ color: var(--_tb-notice-fc);
324
+ text-decoration: var(--_tb-notice-td);
325
+
326
+ border-radius: var(--br-sm);
327
+ display: inline-flex;
328
+ flex-shrink: 0;
329
+ font-size: var(--fs-fine);
330
+ font-weight: 700;
331
+ margin-left: var(--su8);
332
+ margin-right: var(--su8);
333
+ line-height: var(--lh-xxl);
334
+ padding: 0 var(--su6);
335
+ text-transform: uppercase;
336
+ }
337
+
338
+ & &--searchbar {
339
+ #stacks-internals #screen-sm({
340
+ background: var(--theme-topbar-item-background-hover, var(--black-200));
341
+ left: 0;
342
+ max-width: 100%;
343
+ position: absolute;
344
+ right: 0;
345
+ top: 100%;
346
+ });
347
+
348
+ .s-topbar--searchbar--input-group {
349
+ .s-input {
350
+ &::placeholder {
351
+ color: var(--theme-topbar-search-placeholder, var(--black-400));
352
+ font-style: normal;
353
+ }
354
+
355
+ &:not(:focus-visible):not(.focus) {
356
+ box-shadow: var(--theme-topbar-search-shadow);
357
+ }
358
+
359
+ background-color: var(--theme-topbar-search-background, var(--white));
360
+ border-color: var(--theme-topbar-search-border, var(--black-300));
361
+ color: var(--theme-topbar-search-color, var(--black-500));
362
+ display: block;
363
+ line-height: var(--lh-sm);
364
+ }
365
+
366
+ .s-input-icon {
367
+ color: var(--theme-topbar-search-placeholder, var(--black-400));
368
+ }
369
+
370
+ flex-grow: 1;
371
+ position: relative;
372
+ }
373
+
374
+ .s-popover {
375
+ max-width: 100%;
376
+ min-width: var(--_tb-searchbar-popover-wmn);
377
+ padding: 0;
378
+
379
+ .s-popover--content {
380
+ max-height: var(--_tb-searchbar-popover-content-mxh);
381
+ }
382
+ }
383
+
384
+ .s-select {
385
+ #stacks-internals #screen-sm({
386
+ width: 25% !important;
387
+ });
388
+
389
+ > select {
390
+ &:focus-visible,
391
+ &.focus {
392
+ z-index: var(--zi-selected);
393
+ }
394
+
395
+ background-color: var(--theme-topbar-select-background, var(--black-200));
396
+ border-bottom-right-radius: 0 !important;
397
+ border-color: var(--theme-topbar-search-border, var(--black-300));
398
+ border-top-right-radius: 0 !important;
399
+ color: var(--theme-topbar-select-color, var(--black-500));
400
+ height: 100%;
401
+ line-height: var(--lh-sm);
402
+ }
403
+
404
+ + .s-topbar--searchbar--input-group > .s-input {
405
+ border-bottom-left-radius: 0 !important;
406
+ border-top-left-radius: 0 !important;
407
+ }
408
+
409
+ &:before,
410
+ &:after {
411
+ z-index: var(--zi-active); // Make sure our focus ring is above the search input
412
+ }
413
+
414
+ align-self: stretch;
415
+ color: var(--theme-topbar-select-color, var(--black-500));
416
+ margin-right: calc(var(--su-static1) * -1); //-1px
417
+ max-width: calc(var(--s-step) * 2) !important; // wmx2;
418
+ }
419
+
420
+ &.s-topbar--searchbar__open {
421
+ #stacks-internals #screen-sm({
422
+ display: var(--_tb-searchbar-open-d);
423
+ max-width: var(--_tb-searchbar-open-mxw);
424
+ });
425
+ }
426
+
427
+ display: var(--_tb-searchbar-d);
428
+
429
+ align-items: center;
430
+ flex-grow: 1; // Allow the searchbar to grow if there *is* extra space
431
+ flex-shrink: 10000; // Force the searchbar to shrink as much as possible if there's no extra space
432
+ padding: var(--_tb-searchbar-p);
433
+ }
434
+
435
+ & &--skip-link {
436
+ &:not(:focus) {
437
+ &:extend(.v-visible-sr);
438
+ }
439
+
440
+ background-color: var(--theme-secondary-100);
441
+ border-bottom: var(--_tb-bt);
442
+ display: block;
443
+ outline: none;
444
+ padding: var(--su12);
445
+ text-align: center;
446
+ }
447
+
448
+
449
+ .s-navigation {
450
+ .s-navigation--item {
451
+ &:not(.is-selected) {
452
+ &:hover {
453
+ background-color: var(--theme-topbar-item-background-hover, var(--black-200));
454
+ color: var(--theme-topbar-item-color-hover, var(--black-400));
455
+ }
456
+
457
+ color: var(--theme-topbar-item-color, var(--black-400));
458
+ }
459
+ }
460
+ }
461
+
462
+ .s-popover .s-navigation {
463
+ .s-navigation--item {
464
+ &:not(.is-selected) {
465
+ &:hover {
466
+ background-color: var(--black-200);
467
+ color: var(--black-600);
468
+ }
469
+
470
+ color: var(--black-500);
471
+ }
472
+ }
473
+ }
474
+
475
+ align-items: center;
476
+ background-color: var(--theme-topbar-background-color, var(--white));
477
+ border-bottom: var(--theme-topbar-bottom-border, var(--su-static1) solid var(--black-225));
478
+ border-top: var(--_tb-bt);
479
+ display: flex;
480
+ height: var(--_tb-h);
481
+ min-width: auto;
482
+ position: relative;
483
+ width: 100%;
484
+ z-index: var(--zi-navigation-fixed);
485
+ }
486
+
487
+ // DARK/LIGHT VARIANTS
488
+ // NOTE: These are declared outside of the .s-topbar block to allow consumers (Core) to reference them directly
489
+ // TODO move within .s-topbar block once Core no longer references this directly
490
+ .s-topbar__dark {
491
+ // TODO this only works 100% perfectly in dark mode, due to child elements inheriting current theme colors
492
+ // TODO extend forced dark mode instead of overriding
493
+ @topbar-actual-background: .set-black()[600];
494
+
495
+ #calc-topbar-lightness-increase() when (lightness(@topbar-actual-background) < 15%) {
496
+ @topbar-search-lightness-increase: 20%;
497
+ }
498
+ #calc-topbar-lightness-increase() when not (lightness(@topbar-actual-background) < 15%) {
499
+ @topbar-search-lightness-increase: 10%;
500
+ }
501
+ #calc-topbar-lightness-increase();
502
+
503
+ --theme-topbar-background-color: @topbar-actual-background;
504
+ --theme-topbar-bottom-border: var(--su-static1) solid @topbar-actual-background;
505
+
506
+ // Search input
507
+ --theme-topbar-search-color: lighten(@topbar-actual-background, 80% + @topbar-search-lightness-increase);
508
+ --theme-topbar-search-background: lighten(@topbar-actual-background, @topbar-search-lightness-increase);
509
+ --theme-topbar-search-placeholder: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
510
+ --theme-topbar-search-border: lighten(@topbar-actual-background, 20% + @topbar-search-lightness-increase);
511
+
512
+ // Search switcher
513
+ --theme-topbar-select-color: lighten(@topbar-actual-background, 60% + @topbar-search-lightness-increase);
514
+ --theme-topbar-select-background: lighten(@topbar-actual-background, 10% + @topbar-search-lightness-increase);
515
+
516
+ // Items
517
+ --theme-topbar-item-color: .set-black()[225];
518
+ --theme-topbar-item-color-hover: var(--_white-static);
519
+ --theme-topbar-item-background-hover: .set-black()[500];
520
+ --theme-topbar-item-color-current: var(--_white-static);
521
+
522
+ // Themed border accent
523
+ --theme-topbar-accent-border: none;
524
+
525
+ --scrollbar: hsla(0, 0%, 100%, 0.2);
526
+ }
527
+
528
+ // TODO move within .s-topbar block once Core no longer references this directly
529
+ .s-topbar__light {
530
+ // TODO this only works 100% perfectly in light mode, due to child elements inheriting current theme colors
531
+ // TODO extend forced light mode instead of overriding
532
+
533
+ --theme-topbar-background-color: var(--_white-static);
534
+ --theme-topbar-bottom-border: var(--su-static1) solid .set-black()[225];
535
+
536
+ // Search input
537
+ --theme-topbar-search-color: .set-black()[500];
538
+ --theme-topbar-search-background: var(--_white-static);
539
+ --theme-topbar-search-placeholder: .set-black()[400];
540
+ --theme-topbar-search-border: .set-black()[300];
541
+
542
+ // Search switcher
543
+ --theme-topbar-select-color: .set-black()[500];
544
+ --theme-topbar-select-background: .set-black()[200];
545
+
546
+ // Items
547
+ --theme-topbar-item-color: .set-black()[400];
548
+ --theme-topbar-item-color-hover: .set-black()[500];
549
+ --theme-topbar-item-background-hover: .set-black()[200];
550
+ --theme-topbar-item-color-current: var(--_black-static);
551
+
552
+ --scrollbar: hsla(0, 0%, 0%, 0.2);
553
+ }