@stackoverflow/stacks 0.73.1 → 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 +441 -141
  12. package/dist/css/stacks.min.css +1 -1
  13. package/dist/index.d.ts +3 -0
  14. package/dist/js/stacks.js +6130 -5488
  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 -342
  22. package/lib/css/atomic/_stacks-spacing.less +168 -162
  23. package/lib/css/atomic/_stacks-typography.less +273 -270
  24. package/lib/css/atomic/_stacks-width-height.less +195 -189
  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 -724
  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 -311
  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 +237 -209
  59. package/lib/css/components/_stacks-toggle-switches.less +144 -137
  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 -193
  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 -1098
  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,209 +1,209 @@
1
- //
2
- // STACK OVERFLOW
3
- // BADGES
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
- // TABLE OF CONTENTS
10
- // • BASE STYLE
11
- // • STYLE VARIATIONS
12
- // • LAYOUTS & SIZES
13
- //
14
- // ===========================================================================
15
- // $ MIXIN
16
- // Any badge we use will always modify the same items, so to save time,
17
- // here's a mixin to state all that CSS.
18
- // ---------------------------------------------------------------------------
19
- .badge-styles(@border: transparent, @background: transparent, @color: inherit) {
20
- border-color: @border;
21
- background-color: @background;
22
- color: @color;
23
- }
24
-
25
- // ===========================================================================
26
- // $ BASE STYLE
27
- // The same style is applied to all badges. Do not modify the core style.
28
- // ---------------------------------------------------------------------------
29
- .s-badge {
30
- display: inline-flex;
31
- align-items: center;
32
- justify-content: center;
33
- min-width: 0;
34
- padding: 0 @su6;
35
- border-width: 1px;
36
- border-style: solid;
37
- border-radius: @br-sm;
38
- font-size: @fs-caption;
39
- font-weight: normal;
40
- line-height: 2;
41
- text-decoration: none;
42
- vertical-align: middle;
43
- white-space: nowrap;
44
-
45
- .badge-styles(var(--bc-medium), var(--black-050), var(--black-700));
46
-
47
- a&:hover {
48
- text-decoration: none;
49
- }
50
- }
51
-
52
- // $ BADGE IMAGE
53
- // When we have a badge image
54
- // ---------------------------------------------------------------------------
55
- .s-badge--image {
56
- display: inline-flex;
57
- align-self: center;
58
- margin-right: (@su2 / 2);
59
- margin-left: -(@su4 + 1);
60
- }
61
-
62
- // $ BADGE SIZES
63
- // ---------------------------------------------------------------------------
64
- .s-badge__sm {
65
- min-width: 18px;
66
- align-self: flex-start;
67
- padding-right: @su4;
68
- padding-left: @su4;
69
- font-size: @fs-fine;
70
- line-height: 1.8;
71
- }
72
-
73
- .s-badge__xs {
74
- align-self: flex-start;
75
- padding-right: @su2;
76
- padding-left: @su2;
77
- font-size: @fs-fine;
78
- line-height: 1.5;
79
- }
80
-
81
- // $$ Badge Counts
82
- // ---------------------------------------------------------------------------
83
- .s-badge__gold {
84
- .badge-styles(var(--gold-darker), var(--gold-lighter), var(--black-700));
85
- }
86
- .s-badge__silver {
87
- .badge-styles(var(--silver-darker), var(--silver-lighter), var(--black-700));
88
- }
89
- .s-badge__bronze {
90
- .badge-styles(var(--bronze-darker), var(--bronze-lighter), var(--black-700));
91
- }
92
- .s-badge__gold,
93
- .s-badge__silver,
94
- .s-badge__bronze {
95
- .highcontrast-mode({
96
- border-color: currentColor;
97
- color: var(--black-900);
98
- });
99
- }
100
-
101
- // $$ Number Counts
102
- // ---------------------------------------------------------------------------
103
- .s-badge__bounty {
104
- .badge-styles(transparent, var(--blue-600), var(--white));
105
- }
106
- .s-badge__votes {
107
- .badge-styles(var(--black-150), var(--white), var(--black-700));
108
-
109
- .highcontrast-mode({ border-color: currentColor; });
110
- }
111
- .s-badge__answered {
112
- .badge-styles(transparent, var(--green-400), var(--white));
113
- }
114
- .s-badge__rep {
115
- .badge-styles(var(--green-400), var(--white), var(--green-500));
116
- .highcontrast-mode({ border-color: currentColor; });
117
- }
118
- .s-badge__rep-down {
119
- .badge-styles(var(--red-400), var(--white), var(--red-500));
120
- .highcontrast-mode({ border-color: currentColor; });
121
- }
122
- .s-badge__important {
123
- .badge-styles(transparent, var(--red-600), var(--white));
124
- }
125
-
126
- // $$ Users
127
- // ---------------------------------------------------------------------------
128
- .s-badge__admin {
129
- .badge-styles(var(--theme-primary-200), var(--theme-primary-075), var(--theme-primary-800));
130
- .highcontrast-mode({ border-color: currentColor; });
131
- }
132
- .s-badge__moderator {
133
- .badge-styles(var(--theme-secondary-200), var(--theme-secondary-075), var(--theme-secondary-800));
134
- .highcontrast-mode({ border-color: currentColor; });
135
-
136
- &:before {
137
- --s-badge-moderator-icon: url("data:image/svg+xml,%3Csvg width='12' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.528.746c.257-.329.675-.327.93 0l4.42 5.66c.258.329.257.864 0 1.192l-4.42 5.66c-.256.328-.674.327-.93 0l-4.42-5.66c-.257-.329-.256-.865 0-1.192l4.42-5.66z' fill='%23fff'/%3E%3C/svg%3E");
138
-
139
- content: "";
140
- display: inline-block;
141
- background-color: currentColor;
142
- -webkit-mask: var(--s-badge-moderator-icon) no-repeat center;
143
- mask: var(--s-badge-moderator-icon) no-repeat center;
144
- -webkit-mask-size: contain;
145
- mask-size: contain;
146
-
147
- width: 12px;
148
- height: 14px;
149
- margin-top: -1px;
150
- margin-right: 3px;
151
- }
152
-
153
- &.s-badge__sm:before {
154
- --s-badge-moderator-icon: url("data:image/svg+xml,%3Csvg width='9' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.55.246c.257-.329.647-.327.903 0l3.36 4.66c.256.329.256.864 0 1.192L4.45 10.75c-.257.329-.644.327-.9 0L.192 6.098c-.256-.329-.256-.865 0-1.192L3.55.246z' fill='%23fff'/%3E%3C/svg%3E");
155
-
156
- width: 9px;
157
- height: 11px;
158
- margin-top: 0;
159
- margin-right: 2px;
160
- }
161
-
162
- &.s-badge__xs:before {
163
- --s-badge-moderator-icon: url("data:image/svg+xml,%3Csvg width='7' height='9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 .246c.3-.329.701-.327 1 0L6.776 4c.3.329.298.672 0 1L4 8.75c-.299.329-.702.327-1 0L.224 5c-.284-.324-.285-.675 0-1L3 .246z' fill='%23fff'/%3E%3C/svg%3E");
164
-
165
- width: 7px;
166
- height: 9px;
167
- margin-top: 0;
168
- }
169
- }
170
-
171
- .s-badge__staff {
172
- // Staff badges are always "Stack Overflow Orange"
173
- .badge-styles(var(--orange-300), var(--orange-100), var(--orange-900));
174
- .highcontrast-mode({ border-color: currentColor; });
175
- }
176
-
177
- // $$ Award Count
178
- // ---------------------------------------------------------------------------
179
- .s-award-bling {
180
- display: flex;
181
- align-items: center;
182
- color: inherit;
183
-
184
- &:before {
185
- content: "";
186
- margin-right: 4px;
187
- width: 8px;
188
- height: 8px;
189
- border-radius: 100%;
190
- }
191
-
192
- &.s-award-bling__gold {
193
- &:before {
194
- background-color: var(--gold);
195
- }
196
- }
197
-
198
- &.s-award-bling__silver {
199
- &:before {
200
- background-color: var(--silver);
201
- }
202
- }
203
-
204
- &.s-award-bling__bronze {
205
- &:before {
206
- background-color: var(--bronze);
207
- }
208
- }
209
- }
1
+ //
2
+ // STACK OVERFLOW
3
+ // BADGES
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
+ // TABLE OF CONTENTS
10
+ // • BASE STYLE
11
+ // • STYLE VARIATIONS
12
+ // • LAYOUTS & SIZES
13
+ //
14
+ // ===========================================================================
15
+ // $ MIXIN
16
+ // Any badge we use will always modify the same items, so to save time,
17
+ // here's a mixin to state all that CSS.
18
+ // ---------------------------------------------------------------------------
19
+ .badge-styles(@border: transparent, @background: transparent, @color: inherit) {
20
+ border-color: @border;
21
+ background-color: @background;
22
+ color: @color;
23
+ }
24
+
25
+ // ===========================================================================
26
+ // $ BASE STYLE
27
+ // The same style is applied to all badges. Do not modify the core style.
28
+ // ---------------------------------------------------------------------------
29
+ .s-badge {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ min-width: 0;
34
+ padding: 0 @su6;
35
+ border-width: 1px;
36
+ border-style: solid;
37
+ border-radius: @br-sm;
38
+ font-size: @fs-caption;
39
+ font-weight: normal;
40
+ line-height: 2;
41
+ text-decoration: none;
42
+ vertical-align: middle;
43
+ white-space: nowrap;
44
+
45
+ .badge-styles(var(--bc-medium), var(--black-050), var(--black-700));
46
+
47
+ a&:hover {
48
+ text-decoration: none;
49
+ }
50
+ }
51
+
52
+ // $ BADGE IMAGE
53
+ // When we have a badge image
54
+ // ---------------------------------------------------------------------------
55
+ .s-badge--image {
56
+ display: inline-flex;
57
+ align-self: center;
58
+ margin-right: (@su2 / 2);
59
+ margin-left: -(@su4 + 1);
60
+ }
61
+
62
+ // $ BADGE SIZES
63
+ // ---------------------------------------------------------------------------
64
+ .s-badge__sm {
65
+ min-width: 18px;
66
+ align-self: flex-start;
67
+ padding-right: @su4;
68
+ padding-left: @su4;
69
+ font-size: @fs-fine;
70
+ line-height: 1.8;
71
+ }
72
+
73
+ .s-badge__xs {
74
+ align-self: flex-start;
75
+ padding-right: @su2;
76
+ padding-left: @su2;
77
+ font-size: @fs-fine;
78
+ line-height: 1.5;
79
+ }
80
+
81
+ // $$ Badge Counts
82
+ // ---------------------------------------------------------------------------
83
+ .s-badge__gold {
84
+ .badge-styles(var(--gold-darker), var(--gold-lighter), var(--black-700));
85
+ }
86
+ .s-badge__silver {
87
+ .badge-styles(var(--silver-darker), var(--silver-lighter), var(--black-700));
88
+ }
89
+ .s-badge__bronze {
90
+ .badge-styles(var(--bronze-darker), var(--bronze-lighter), var(--black-700));
91
+ }
92
+ .s-badge__gold,
93
+ .s-badge__silver,
94
+ .s-badge__bronze {
95
+ .highcontrast-mode({
96
+ border-color: currentColor;
97
+ color: var(--black-900);
98
+ });
99
+ }
100
+
101
+ // $$ Number Counts
102
+ // ---------------------------------------------------------------------------
103
+ .s-badge__bounty {
104
+ .badge-styles(transparent, var(--blue-600), var(--white));
105
+ }
106
+ .s-badge__votes {
107
+ .badge-styles(var(--black-150), var(--white), var(--black-700));
108
+
109
+ .highcontrast-mode({ border-color: currentColor; });
110
+ }
111
+ .s-badge__answered {
112
+ .badge-styles(transparent, var(--green-400), var(--white));
113
+ }
114
+ .s-badge__rep {
115
+ .badge-styles(var(--green-400), var(--white), var(--green-500));
116
+ .highcontrast-mode({ border-color: currentColor; });
117
+ }
118
+ .s-badge__rep-down {
119
+ .badge-styles(var(--red-400), var(--white), var(--red-500));
120
+ .highcontrast-mode({ border-color: currentColor; });
121
+ }
122
+ .s-badge__important {
123
+ .badge-styles(transparent, var(--red-600), var(--white));
124
+ }
125
+
126
+ // $$ Users
127
+ // ---------------------------------------------------------------------------
128
+ .s-badge__admin {
129
+ .badge-styles(var(--theme-primary-200), var(--theme-primary-075), var(--theme-primary-800));
130
+ .highcontrast-mode({ border-color: currentColor; });
131
+ }
132
+ .s-badge__moderator {
133
+ .badge-styles(var(--theme-secondary-200), var(--theme-secondary-075), var(--theme-secondary-800));
134
+ .highcontrast-mode({ border-color: currentColor; });
135
+
136
+ &:before {
137
+ --s-badge-moderator-icon: url("data:image/svg+xml,%3Csvg width='12' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.528.746c.257-.329.675-.327.93 0l4.42 5.66c.258.329.257.864 0 1.192l-4.42 5.66c-.256.328-.674.327-.93 0l-4.42-5.66c-.257-.329-.256-.865 0-1.192l4.42-5.66z' fill='%23fff'/%3E%3C/svg%3E");
138
+
139
+ content: "";
140
+ display: inline-block;
141
+ background-color: currentColor;
142
+ -webkit-mask: var(--s-badge-moderator-icon) no-repeat center;
143
+ mask: var(--s-badge-moderator-icon) no-repeat center;
144
+ -webkit-mask-size: contain;
145
+ mask-size: contain;
146
+
147
+ width: 12px;
148
+ height: 14px;
149
+ margin-top: -1px;
150
+ margin-right: 3px;
151
+ }
152
+
153
+ &.s-badge__sm:before {
154
+ --s-badge-moderator-icon: url("data:image/svg+xml,%3Csvg width='9' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.55.246c.257-.329.647-.327.903 0l3.36 4.66c.256.329.256.864 0 1.192L4.45 10.75c-.257.329-.644.327-.9 0L.192 6.098c-.256-.329-.256-.865 0-1.192L3.55.246z' fill='%23fff'/%3E%3C/svg%3E");
155
+
156
+ width: 9px;
157
+ height: 11px;
158
+ margin-top: 0;
159
+ margin-right: 2px;
160
+ }
161
+
162
+ &.s-badge__xs:before {
163
+ --s-badge-moderator-icon: url("data:image/svg+xml,%3Csvg width='7' height='9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 .246c.3-.329.701-.327 1 0L6.776 4c.3.329.298.672 0 1L4 8.75c-.299.329-.702.327-1 0L.224 5c-.284-.324-.285-.675 0-1L3 .246z' fill='%23fff'/%3E%3C/svg%3E");
164
+
165
+ width: 7px;
166
+ height: 9px;
167
+ margin-top: 0;
168
+ }
169
+ }
170
+
171
+ .s-badge__staff {
172
+ // Staff badges are always "Stack Overflow Orange"
173
+ .badge-styles(var(--orange-300), var(--orange-100), var(--orange-900));
174
+ .highcontrast-mode({ border-color: currentColor; });
175
+ }
176
+
177
+ // $$ Award Count
178
+ // ---------------------------------------------------------------------------
179
+ .s-award-bling {
180
+ display: flex;
181
+ align-items: center;
182
+ color: inherit;
183
+
184
+ &:before {
185
+ content: "";
186
+ margin-right: 4px;
187
+ width: 8px;
188
+ height: 8px;
189
+ border-radius: 100%;
190
+ }
191
+
192
+ &.s-award-bling__gold {
193
+ &:before {
194
+ background-color: var(--gold);
195
+ }
196
+ }
197
+
198
+ &.s-award-bling__silver {
199
+ &:before {
200
+ background-color: var(--silver);
201
+ }
202
+ }
203
+
204
+ &.s-award-bling__bronze {
205
+ &:before {
206
+ background-color: var(--bronze);
207
+ }
208
+ }
209
+ }
@@ -1,81 +1,80 @@
1
- //
2
- // STACK OVERFLOW
3
- // BANNERS
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
- // TABLE OF CONTENTS
10
- // • SYSTEM BANNERS
11
- //
12
- // ============================================================================
13
- // When we use .s-banner, we need to adjust the padding-top on
14
- // the body tag. This class correctly adjusts the body padding ONLY if
15
- // the notice is one line. If it wraps to multiple lines, more classes or
16
- // (ideally) JS will need to be used to determine the notice's height
17
- // at the time of render. The padding value is determined like so:
18
- //
19
- // 50px (top bar) + 44px (notice height) - 1px (bottom border)
20
- //
21
- // The borders subtraction are necessary to neatly tuck everything together.
22
- // ----------------------------------------------------------------------------
23
- .s-banner__body-pt {
24
- padding-top: 93px;
25
- }
26
-
27
- // ============================================================================
28
- // $ SYSTEM BANNERS
29
- // ----------------------------------------------------------------------------
30
- .s-banner {
31
- position: fixed;
32
- z-index: @zi-navigation-fixed - 1; // Tuck below topbar
33
- top: 0;
34
- right: 0;
35
- left: 0;
36
- width: 100%;
37
- padding: @su12;
38
- border-top: 1px solid transparent;
39
- border-bottom: 1px solid transparent;
40
- border-radius: 0;
41
- box-shadow: none;
42
- color: var(--fc-medium);
43
- font-size: @fs-body1;
44
-
45
- // If you want to hide and reveal the banner
46
- &[aria-hidden="true"] {
47
- visibility: hidden;
48
- opacity: 0;
49
- -webkit-transform: translate3d(0, -50px, 0);
50
- transform: translate3d(0, -50px, 0);
51
- }
52
-
53
- &[aria-hidden="false"] {
54
- visibility: visible;
55
- opacity: 1;
56
- -webkit-transform: translate3d(0, 49px, 0);
57
- transform: translate3d(0, 49px, 0);
58
- }
59
-
60
- // If you want to put the banner above the topbar
61
- &.is-pinned {
62
- z-index: @zi-navigation-fixed + 1;
63
- -webkit-transform: translate3d(0, 0, 0);
64
- transform: translate3d(0, 0, 0);
65
- }
66
-
67
- // If it's a really important banner
68
- &.s-banner__important {
69
- border-color: transparent;
70
- color: var(--white);
71
- }
72
- }
73
-
74
- // -- When we want to keep hero content capped
75
- .s-banner--container {
76
- #stacks-internals #load-config();
77
- position: relative;
78
- width: 100%;
79
- max-width: @body-site-width;
80
- margin: 0 auto;
81
- }
1
+ //
2
+ // STACK OVERFLOW
3
+ // BANNERS
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
+ // TABLE OF CONTENTS
10
+ // • SYSTEM BANNERS
11
+ //
12
+ // ============================================================================
13
+ // When we use .s-banner, we need to adjust the padding-top on
14
+ // the body tag. This class correctly adjusts the body padding ONLY if
15
+ // the notice is one line. If it wraps to multiple lines, more classes or
16
+ // (ideally) JS will need to be used to determine the notice's height
17
+ // at the time of render. The padding value is determined like so:
18
+ //
19
+ // 50px (top bar) + 44px (notice height) - 1px (bottom border)
20
+ //
21
+ // The borders subtraction are necessary to neatly tuck everything together.
22
+ // ----------------------------------------------------------------------------
23
+ .s-banner__body-pt {
24
+ padding-top: 93px;
25
+ }
26
+
27
+ // ============================================================================
28
+ // $ SYSTEM BANNERS
29
+ // ----------------------------------------------------------------------------
30
+ .s-banner {
31
+ position: fixed;
32
+ z-index: @zi-navigation-fixed - 1; // Tuck below topbar
33
+ top: 0;
34
+ right: 0;
35
+ left: 0;
36
+ width: 100%;
37
+ padding: @su12;
38
+ border-top: 1px solid transparent;
39
+ border-bottom: 1px solid transparent;
40
+ border-radius: 0;
41
+ box-shadow: none;
42
+ color: var(--fc-medium);
43
+ font-size: @fs-body1;
44
+
45
+ // If you want to hide and reveal the banner
46
+ &[aria-hidden="true"] {
47
+ visibility: hidden;
48
+ opacity: 0;
49
+ -webkit-transform: translate3d(0, -50px, 0);
50
+ transform: translate3d(0, -50px, 0);
51
+ }
52
+
53
+ &[aria-hidden="false"] {
54
+ visibility: visible;
55
+ opacity: 1;
56
+ -webkit-transform: translate3d(0, 49px, 0);
57
+ transform: translate3d(0, 49px, 0);
58
+ }
59
+
60
+ // If you want to put the banner above the topbar
61
+ &.is-pinned {
62
+ z-index: @zi-navigation-fixed + 1;
63
+ -webkit-transform: translate3d(0, 0, 0);
64
+ transform: translate3d(0, 0, 0);
65
+ }
66
+
67
+ // If it's a really important banner
68
+ &.s-banner__important {
69
+ border-color: transparent;
70
+ color: var(--white);
71
+ }
72
+ }
73
+
74
+ // -- When we want to keep hero content capped
75
+ .s-banner--container {
76
+ position: relative;
77
+ width: 100%;
78
+ max-width: @s-step * 10;
79
+ margin: 0 auto;
80
+ }
@@ -1,26 +1,26 @@
1
- //
2
- // STACK OVERFLOW
3
- // EMPTY STATES
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
- // ============================================================================
10
- // $ BASE STYLE
11
- // ----------------------------------------------------------------------------
12
- .s-empty-state {
13
- color: var(--fc-light);
14
- text-align: center;
15
- margin-left: auto;
16
- margin-right: auto;
17
-
18
- p {
19
- font-size: @fs-body1;
20
- margin-bottom: @su12;
21
-
22
- strong {
23
- color: var(--fc-dark);
24
- }
25
- }
26
- }
1
+ //
2
+ // STACK OVERFLOW
3
+ // EMPTY STATES
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
+ // ============================================================================
10
+ // $ BASE STYLE
11
+ // ----------------------------------------------------------------------------
12
+ .s-empty-state {
13
+ color: var(--fc-light);
14
+ text-align: center;
15
+ margin-left: auto;
16
+ margin-right: auto;
17
+
18
+ p {
19
+ font-size: @fs-body1;
20
+ margin-bottom: @su12;
21
+
22
+ strong {
23
+ color: var(--fc-dark);
24
+ }
25
+ }
26
+ }