@stackoverflow/stacks 1.5.0 → 1.6.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.
- package/dist/css/stacks.css +1584 -1666
- package/dist/css/stacks.min.css +1 -1
- package/lib/css/atomic/colors.less +1 -1
- package/lib/css/components/badges.less +3 -3
- package/lib/css/components/button-groups.less +59 -83
- package/lib/css/components/buttons.less +384 -585
- package/lib/css/components/code-blocks.less +98 -125
- package/lib/css/components/inputs.less +38 -24
- package/lib/css/components/link-previews.less +110 -122
- package/lib/css/components/links.less +0 -16
- package/lib/css/components/notices.less +187 -180
- package/lib/css/components/post-summary.less +0 -9
- package/lib/css/components/progress-bars.less +236 -297
- package/lib/css/components/prose.less +293 -380
- package/lib/css/components/sidebar-widgets.less +251 -0
- package/lib/css/components/tables.less +0 -24
- package/lib/css/components/topbar.less +10 -11
- package/lib/css/stacks-dynamic.less +0 -1
- package/lib/css/stacks-static.less +1 -1
- package/package.json +9 -9
- package/lib/css/components/_styles-template.less +0 -78
- package/lib/css/components/widget-dynamic.less +0 -33
- package/lib/css/components/widget-static.less +0 -274
|
@@ -1,223 +1,223 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
.construct-notice-component() {
|
|
10
|
-
background: var(--_no-bg, var(--black-050));
|
|
11
|
-
border-color: var(--_no-bc, var(--bc-medium));
|
|
12
|
-
border-style: solid;
|
|
13
|
-
color: var(--_no-fc, var(--fc-medium));
|
|
14
|
-
font-size: var(--fs-body1);
|
|
15
|
-
|
|
16
|
-
code {
|
|
17
|
-
background: var(--_no-code-bg, transparent);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
& &--btn {
|
|
21
|
-
color: inherit;
|
|
22
|
-
padding: var(--su8);
|
|
23
|
-
|
|
24
|
-
&:focus,
|
|
25
|
-
&:hover {
|
|
26
|
-
background: var(--_no-btn-focus-bg, var(--black-100));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:active {
|
|
30
|
-
background: var(--_no-btn-active-bg, var(--black-150));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
.construct-notice-component(@baseClass) {
|
|
2
|
+
// BASE COMPONENT-SPECIFIC CUSTOM PROPERTIES
|
|
3
|
+
--_no-bc: var(--bc-medium);
|
|
4
|
+
--_no-bg: var(--black-050);
|
|
5
|
+
--_no-fc: var(--fc-medium);
|
|
6
|
+
--_no-btn-bg-focus: var(--black-100);
|
|
7
|
+
--_no-btn-bg-active: var(--black-150);
|
|
33
8
|
|
|
9
|
+
// MODIFIERS
|
|
34
10
|
&:not(&__important) {
|
|
35
|
-
.dark-mode({
|
|
36
|
-
|
|
37
|
-
|
|
11
|
+
.dark-mode({
|
|
12
|
+
--_no-bc: var(--_no-bg);
|
|
13
|
+
});
|
|
14
|
+
.highcontrast-mode({
|
|
15
|
+
--_no-bc: currentColor;
|
|
16
|
+
});
|
|
17
|
+
.highcontrast-dark-mode({
|
|
18
|
+
--_no-bc: currentColor;
|
|
19
|
+
});
|
|
38
20
|
}
|
|
39
|
-
|
|
40
21
|
&__important {
|
|
41
22
|
--_no-bc: var(--_no-bg);
|
|
42
23
|
--_no-bg: var(--black-700);
|
|
43
24
|
--_no-fc: var(--white);
|
|
44
|
-
--_no-btn-focus
|
|
45
|
-
--_no-btn-active
|
|
25
|
+
--_no-btn-bg-focus: var(--black-800);
|
|
26
|
+
--_no-btn-bg-active: var(--black-900);
|
|
46
27
|
|
|
47
|
-
.highcontrast-mode({
|
|
28
|
+
.highcontrast-mode({
|
|
29
|
+
--_no-bc: var(--_no-bg);
|
|
30
|
+
});
|
|
48
31
|
}
|
|
49
32
|
|
|
33
|
+
// VARIANTS
|
|
50
34
|
&__danger {
|
|
51
35
|
--_no-bc: var(--red-200);
|
|
52
36
|
--_no-bg: var(--red-050);
|
|
53
|
-
--_no-btn-
|
|
54
|
-
--_no-btn-
|
|
55
|
-
}
|
|
56
|
-
&__danger:not(&__important) {
|
|
57
|
-
.highcontrast-mode({
|
|
58
|
-
--_no-bg: var(--red-200);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
&__danger&__important {
|
|
62
|
-
--_no-bc: var(--_no-bg);
|
|
63
|
-
--_no-bg: var(--red-500);
|
|
64
|
-
--_no-btn-focus-bg: var(--red-600);
|
|
65
|
-
--_no-btn-active-bg: var(--red-700);
|
|
37
|
+
--_no-btn-bg-active: var(--red-200);
|
|
38
|
+
--_no-btn-bg-focus: var(--red-100);
|
|
66
39
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
40
|
+
&:not(.@{baseClass}__important) {
|
|
41
|
+
.highcontrast-mode({
|
|
42
|
+
--_no-bg: var(--red-200);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
&.@{baseClass}__important {
|
|
46
|
+
--_no-bc: var(--_no-bg);
|
|
72
47
|
--_no-bg: var(--red-500);
|
|
73
|
-
--_no-
|
|
74
|
-
|
|
75
|
-
}
|
|
48
|
+
--_no-btn-bg-active: var(--red-700);
|
|
49
|
+
--_no-btn-bg-focus: var(--red-600);
|
|
76
50
|
|
|
51
|
+
.dark-mode({
|
|
52
|
+
--_no-bg: var(--red-400);
|
|
53
|
+
--_no-fc: var(--black-900);
|
|
54
|
+
});
|
|
55
|
+
.highcontrast-dark-mode({
|
|
56
|
+
--_no-bg: var(--red-500);
|
|
57
|
+
--_no-fc: var(--white);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
77
61
|
&__info {
|
|
78
62
|
--_no-bc: var(--theme-secondary-150);
|
|
79
63
|
--_no-bg: var(--theme-secondary-050);
|
|
80
|
-
--_no-btn-focus
|
|
81
|
-
--_no-btn-active
|
|
64
|
+
--_no-btn-bg-focus: var(--theme-secondary-100);
|
|
65
|
+
--_no-btn-bg-active: var(--theme-secondary-150);
|
|
82
66
|
--_no-code-bg: var(--theme-secondary-150);
|
|
83
|
-
}
|
|
84
|
-
&__info:not(&__important) {
|
|
85
|
-
.highcontrast-mode({
|
|
86
|
-
--_no-bg: var(--theme-secondary-100);
|
|
87
|
-
});
|
|
88
|
-
.highcontrast-dark-mode({
|
|
89
|
-
--_no-bg: var(--theme-secondary-100);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
&__info&__important {
|
|
93
|
-
--_no-bc: var(--_no-bg);
|
|
94
|
-
--_no-bg: var(--theme-secondary-400);
|
|
95
|
-
--_no-btn-focus-bg: var(--theme-secondary-500);
|
|
96
|
-
--_no-btn-active-bg: var(--theme-secondary-600);
|
|
97
67
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
68
|
+
&:not(.@{baseClass}__important) {
|
|
69
|
+
.highcontrast-mode({
|
|
70
|
+
--_no-bg: var(--theme-secondary-100);
|
|
71
|
+
});
|
|
72
|
+
.highcontrast-dark-mode({
|
|
73
|
+
--_no-bg: var(--theme-secondary-100);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
&.@{baseClass}__important {
|
|
77
|
+
--_no-bc: var(--_no-bg);
|
|
103
78
|
--_no-bg: var(--theme-secondary-400);
|
|
104
|
-
--_no-
|
|
105
|
-
|
|
106
|
-
}
|
|
79
|
+
--_no-btn-bg-active: var(--theme-secondary-600);
|
|
80
|
+
--_no-btn-bg-focus: var(--theme-secondary-500);
|
|
107
81
|
|
|
82
|
+
.dark-mode({
|
|
83
|
+
--_no-bg: var(--theme-secondary-300);
|
|
84
|
+
--_no-fc: var(--black-900);
|
|
85
|
+
});
|
|
86
|
+
.highcontrast-dark-mode({
|
|
87
|
+
--_no-bg: var(--theme-secondary-400);
|
|
88
|
+
--_no-fc: var(--white);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
108
92
|
&__success {
|
|
109
93
|
--_no-bc: var(--green-200);
|
|
110
94
|
--_no-bg: var(--green-050);
|
|
111
|
-
--_no-btn-
|
|
112
|
-
--_no-btn-
|
|
113
|
-
}
|
|
114
|
-
&__success:not(&__important) {
|
|
115
|
-
.highcontrast-mode({
|
|
116
|
-
--_no-bg: var(--green-200);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
&__success&__important {
|
|
120
|
-
--_no-bc: var(--_no-bg);
|
|
121
|
-
--_no-bg: var(--green-400);
|
|
122
|
-
--_no-fc: var(--black-900);
|
|
123
|
-
--_no-btn-focus-bg: var(--green-500);
|
|
124
|
-
--_no-btn-active-bg: var(--green-600);
|
|
95
|
+
--_no-btn-bg-active: var(--green-200);
|
|
96
|
+
--_no-btn-bg-focus: var(--green-100);
|
|
125
97
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
--_no-
|
|
133
|
-
|
|
134
|
-
|
|
98
|
+
&:not(.@{baseClass}__important) {
|
|
99
|
+
.highcontrast-mode({
|
|
100
|
+
--_no-bg: var(--green-200);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
&.@{baseClass}__important {
|
|
104
|
+
--_no-bc: var(--_no-bg);
|
|
105
|
+
--_no-bg: var(--green-400);
|
|
106
|
+
--_no-fc: var(--black-900);
|
|
107
|
+
--_no-btn-bg-active: var(--green-600);
|
|
108
|
+
--_no-btn-bg-focus: var(--green-500);
|
|
135
109
|
|
|
110
|
+
.dark-mode({
|
|
111
|
+
--_no-bg: var(--green-500);
|
|
112
|
+
--_no-fc: var(--white);
|
|
113
|
+
});
|
|
114
|
+
.highcontrast-mode({
|
|
115
|
+
--_no-bg: var(--green-500);
|
|
116
|
+
--_no-fc: var(--white);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
136
120
|
&__warning {
|
|
137
121
|
--_no-bc: var(--yellow-300);
|
|
138
122
|
--_no-bg: var(--yellow-050);
|
|
139
|
-
--_no-btn-
|
|
140
|
-
--_no-btn-
|
|
123
|
+
--_no-btn-bg-active: var(--yellow-300);
|
|
124
|
+
--_no-btn-bg-focus: var(--yellow-200);
|
|
141
125
|
--_no-code-bg: var(--yellow-200);
|
|
126
|
+
|
|
127
|
+
&:not(.@{baseClass}__important) {
|
|
128
|
+
.highcontrast-mode({
|
|
129
|
+
--_no-bg: var(--yellow-200);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
&.@{baseClass}__important {
|
|
133
|
+
--_no-bc: var(--_no-bg);
|
|
134
|
+
--_no-bg: var(--yellow-400);
|
|
135
|
+
--_no-fc: var(--black-900);
|
|
136
|
+
--_no-btn-bg-active: var(--yellow-600);
|
|
137
|
+
--_no-btn-bg-focus: var(--yellow-500);
|
|
138
|
+
|
|
139
|
+
.dark-mode({
|
|
140
|
+
--_no-bg: var(--yellow-600);
|
|
141
|
+
--_no-fc: var(--white);
|
|
142
|
+
});
|
|
143
|
+
.highcontrast-mode({
|
|
144
|
+
--_no-bg: var(--yellow-700);
|
|
145
|
+
--_no-fc: var(--white);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
142
148
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
|
|
150
|
+
// CHILD ELEMENTS
|
|
151
|
+
code {
|
|
152
|
+
background: var(--_no-code-bg, transparent);
|
|
147
153
|
}
|
|
148
|
-
&
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
& &--btn {
|
|
155
|
+
&:focus,
|
|
156
|
+
&:hover {
|
|
157
|
+
background: var(--_no-btn-bg-focus);
|
|
158
|
+
}
|
|
159
|
+
&:active {
|
|
160
|
+
background: var(--_no-btn-bg-active);
|
|
161
|
+
}
|
|
154
162
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
--_no-fc: var(--white);
|
|
158
|
-
});
|
|
159
|
-
.highcontrast-mode({
|
|
160
|
-
--_no-bg: var(--yellow-700);
|
|
161
|
-
--_no-fc: var(--white);
|
|
162
|
-
});
|
|
163
|
+
color: inherit;
|
|
164
|
+
padding: var(--su8);
|
|
163
165
|
}
|
|
166
|
+
|
|
167
|
+
// STYLES MODIFIED BY COMPONENT-SPECIFIC CUSTOM PROPERTIES
|
|
168
|
+
background: var(--_no-bg);
|
|
169
|
+
border-color: var(--_no-bc);
|
|
170
|
+
color: var(--_no-fc);
|
|
171
|
+
|
|
172
|
+
border-style: solid;
|
|
173
|
+
font-size: var(--fs-body1);
|
|
164
174
|
}
|
|
165
175
|
|
|
166
176
|
// Banner
|
|
167
177
|
// TODO deprecate .s-banner (by turning it into a modifier on .s-notice)
|
|
168
178
|
// This would reduce the amount of CSS we ship to the client and simplify our codebase
|
|
169
179
|
.s-banner {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
// (ideally) JS will need to be used to determine the notice's height
|
|
176
|
-
// at the time of render. The padding value is determined like so:
|
|
177
|
-
//
|
|
178
|
-
// 50px (top bar) + 44px (notice height) - 1px (bottom border)
|
|
179
|
-
//
|
|
180
|
-
// The borders subtraction are necessary to neatly tuck everything together.
|
|
181
|
-
// ----------------------------------------------------------------------------
|
|
182
|
-
&__body-pt {
|
|
183
|
-
padding-top: 93px;
|
|
184
|
-
}
|
|
185
|
-
// If you want to put the banner above the topbar
|
|
186
|
-
&.is-pinned {
|
|
187
|
-
z-index: calc(var(--zi-navigation-fixed) + 1);
|
|
188
|
-
}
|
|
189
|
-
// If you want to hide and reveal the banner
|
|
190
|
-
&[aria-hidden="true"] {
|
|
191
|
-
--_no-x-offset: -50px; // TODO convert to su vars
|
|
192
|
-
visibility: hidden;
|
|
180
|
+
--_no-x-offset: 0; // [1]
|
|
181
|
+
.construct-notice-component(s-banner);
|
|
182
|
+
|
|
183
|
+
&[aria-hidden="true"] { // If you want to hide and reveal the banner
|
|
184
|
+
--_no-x-offset: calc(var(--su48) + var(--su2) * -1); // -50px
|
|
193
185
|
opacity: 0;
|
|
186
|
+
visibility: hidden;
|
|
194
187
|
}
|
|
195
188
|
&[aria-hidden="false"] {
|
|
196
|
-
--_no-x-offset:
|
|
197
|
-
visibility: visible;
|
|
189
|
+
--_no-x-offset: calc(var(--su48) + var(--su1)); // 49px
|
|
198
190
|
opacity: 1;
|
|
191
|
+
visibility: visible;
|
|
192
|
+
}
|
|
193
|
+
&.is-pinned { // If you want to put the banner above the topbar
|
|
194
|
+
z-index: calc(var(--zi-navigation-fixed) + 1);
|
|
195
|
+
}
|
|
196
|
+
&__body-pt {
|
|
197
|
+
padding-top: 93px;
|
|
199
198
|
}
|
|
200
|
-
// When we want to keep hero content capped
|
|
201
|
-
|
|
199
|
+
& &--container { // When we want to keep hero content capped
|
|
200
|
+
margin: 0 auto;
|
|
201
|
+
max-width: calc(var(--s-step) * 10);
|
|
202
202
|
position: relative;
|
|
203
203
|
width: 100%;
|
|
204
|
-
max-width: calc(var(--s-step) * 10);
|
|
205
|
-
margin: 0 auto;
|
|
206
204
|
}
|
|
207
205
|
|
|
206
|
+
-webkit-transform: translate3d(0, var(--_no-x-offset), 0);
|
|
207
|
+
transform: translate3d(0, var(--_no-x-offset), 0);
|
|
208
|
+
|
|
208
209
|
border-width: var(--su-static1) 0;
|
|
209
210
|
inset: 0 0 auto 0;
|
|
210
211
|
padding: var(--su12);
|
|
211
212
|
position: fixed;
|
|
212
213
|
width: 100%;
|
|
213
214
|
z-index: calc(var(--zi-navigation-fixed) - 1); // Tuck below topbar
|
|
214
|
-
-webkit-transform: translate3d(0, var(--_no-x-offset), 0);
|
|
215
|
-
transform: translate3d(0, var(--_no-x-offset), 0);
|
|
216
215
|
}
|
|
217
216
|
|
|
218
217
|
// Notice
|
|
219
218
|
.s-notice {
|
|
220
|
-
.construct-notice-component();
|
|
219
|
+
.construct-notice-component(s-notice);
|
|
220
|
+
|
|
221
221
|
border-radius: var(--br-sm);
|
|
222
222
|
border-width: var(--su-static1);
|
|
223
223
|
padding: var(--su16);
|
|
@@ -225,36 +225,43 @@
|
|
|
225
225
|
|
|
226
226
|
// Toast
|
|
227
227
|
.s-toast {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
justify-content: center;
|
|
232
|
-
top: var(--su16);
|
|
233
|
-
left: var(--su8);
|
|
234
|
-
right: var(--su8);
|
|
235
|
-
opacity: 0;
|
|
236
|
-
z-index: calc(var(--zi-modals) + 1); // Toasts should appear above modals
|
|
237
|
-
transform: translate3d(0, -66px, 0);
|
|
238
|
-
transition: transform 100ms var(--te-smooth-slow) 0s, opacity 60ms var(--te-smooth-slow) 0ms, visibility 0s 150ms;
|
|
239
|
-
pointer-events: none;
|
|
240
|
-
|
|
228
|
+
@media (prefers-reduced-motion) {
|
|
229
|
+
transform: none !important;
|
|
230
|
+
}
|
|
241
231
|
&[aria-hidden="false"] {
|
|
242
|
-
visibility: visible;
|
|
243
232
|
opacity: 1;
|
|
244
233
|
transform: translate3d(0, 0, 0);
|
|
245
234
|
transition: visibility 0s 0s, opacity 100ms var(--te-smooth) 0s, transform 100ms var(--te-smooth) 0s;
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
@media (prefers-reduced-motion) {
|
|
249
|
-
transform: none;
|
|
235
|
+
visibility: visible;
|
|
250
236
|
}
|
|
251
237
|
|
|
252
238
|
.s-notice {
|
|
239
|
+
box-shadow: var(--bs-sm);
|
|
253
240
|
max-width: 44rem;
|
|
254
|
-
width: 100%;
|
|
255
|
-
padding-top: var(--su8);
|
|
256
241
|
padding-bottom: var(--su8);
|
|
257
|
-
|
|
242
|
+
padding-top: var(--su8);
|
|
258
243
|
pointer-events: all;
|
|
244
|
+
width: 100%;
|
|
259
245
|
}
|
|
246
|
+
|
|
247
|
+
display: flex;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
left: var(--su8);
|
|
250
|
+
opacity: 0;
|
|
251
|
+
pointer-events: none;
|
|
252
|
+
position: fixed;
|
|
253
|
+
right: var(--su8);
|
|
254
|
+
top: var(--su16);
|
|
255
|
+
transform: translate3d(0, -66px, 0);
|
|
256
|
+
transition: transform 100ms var(--te-smooth-slow) 0s, opacity 60ms var(--te-smooth-slow) 0ms, visibility 0s 150ms;
|
|
257
|
+
visibility: hidden;
|
|
258
|
+
z-index: calc(var(--zi-modals) + 1); // Toasts should appear above modals
|
|
260
259
|
}
|
|
260
|
+
|
|
261
|
+
// [1] When we use .s-banner, we need to adjust the padding-top on
|
|
262
|
+
// the body tag. This class correctly adjusts the body padding ONLY if
|
|
263
|
+
// the notice is one line. If it wraps to multiple lines, more classes or
|
|
264
|
+
// (ideally) JS will need to be used to determine the notice's height
|
|
265
|
+
// at the time of render. The padding value is determined like so:
|
|
266
|
+
// 50px (top bar) + 44px (notice height) - 1px (bottom border)
|
|
267
|
+
// The borders subtraction are necessary to neatly tuck everything together.
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
// STACK OVERFLOW
|
|
3
|
-
// POST SUMMARY
|
|
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
1
|
.s-post-summary {
|
|
11
2
|
position: relative;
|
|
12
3
|
display: flex;
|