@stackoverflow/stacks 1.0.0 → 1.2.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/README.md +47 -47
- package/dist/controllers/s-popover.d.ts +11 -2
- package/dist/css/stacks.css +257 -8
- package/dist/css/stacks.min.css +1 -1
- package/dist/js/stacks.js +18 -2
- package/dist/js/stacks.min.js +1 -1
- package/lib/css/atomic/borders.less +378 -378
- package/lib/css/atomic/colors.less +209 -209
- package/lib/css/atomic/flex.less +375 -375
- package/lib/css/atomic/grid.less +174 -174
- package/lib/css/atomic/misc.less +343 -343
- package/lib/css/atomic/spacing.less +342 -314
- package/lib/css/atomic/typography.less +273 -273
- package/lib/css/atomic/width-height.less +194 -194
- package/lib/css/base/body.less +44 -44
- package/lib/css/base/configuration-static.less +61 -61
- package/lib/css/base/icons.less +20 -20
- package/lib/css/base/internals.less +220 -220
- package/lib/css/base/reset-meyer.less +64 -64
- package/lib/css/base/reset-normalize.less +449 -449
- package/lib/css/base/reset.less +20 -20
- package/lib/css/components/activity-indicator.less +44 -45
- package/lib/css/components/avatars.less +189 -189
- package/lib/css/components/badges.less +254 -209
- package/lib/css/components/banners.less +80 -80
- package/lib/css/components/blank-states.less +26 -26
- package/lib/css/components/breadcrumbs.less +44 -44
- package/lib/css/components/button-groups.less +104 -104
- package/lib/css/components/buttons.less +665 -665
- package/lib/css/components/cards.less +44 -44
- package/lib/css/components/code-blocks.less +130 -130
- package/lib/css/components/collapsible.less +104 -104
- package/lib/css/components/inputs.less +728 -728
- package/lib/css/components/link-previews.less +136 -136
- package/lib/css/components/links.less +218 -218
- package/lib/css/components/menu.less +47 -47
- package/lib/css/components/modals.less +133 -133
- package/lib/css/components/navigation.less +146 -146
- package/lib/css/components/notices.less +233 -233
- package/lib/css/components/page-titles.less +60 -60
- package/lib/css/components/pagination.less +55 -55
- package/lib/css/components/popovers.less +197 -197
- package/lib/css/components/post-summary.less +436 -425
- package/lib/css/components/progress-bars.less +330 -330
- package/lib/css/components/prose.less +503 -503
- package/lib/css/components/spinner.less +107 -107
- package/lib/css/components/tables.less +341 -341
- package/lib/css/components/tags.less +236 -236
- package/lib/css/components/toggle-switches.less +144 -144
- package/lib/css/components/topbar.less +427 -427
- package/lib/css/components/uploader.less +210 -210
- package/lib/css/components/user-cards.less +169 -169
- package/lib/css/components/widget-dynamic.less +33 -33
- package/lib/css/components/widget-static.less +273 -273
- package/lib/css/exports/constants-colors.less +1092 -1092
- package/lib/css/exports/constants-helpers.less +108 -108
- package/lib/css/exports/constants-type.less +153 -153
- package/lib/css/exports/exports.less +15 -15
- package/lib/css/exports/mixins.less +237 -237
- package/lib/css/stacks-dynamic.less +35 -35
- package/lib/css/stacks-static.less +86 -86
- package/lib/css/stacks.less +13 -13
- package/lib/ts/controllers/index.ts +7 -7
- package/lib/ts/controllers/s-expandable-control.ts +188 -188
- package/lib/ts/controllers/s-modal.ts +321 -321
- package/lib/ts/controllers/s-navigation-tablist.ts +117 -117
- package/lib/ts/controllers/s-popover.ts +567 -547
- package/lib/ts/controllers/s-table.ts +220 -220
- package/lib/ts/controllers/s-tooltip.ts +246 -246
- package/lib/ts/controllers/s-uploader.ts +172 -172
- package/lib/ts/index.ts +20 -20
- package/lib/ts/stacks.ts +88 -88
- package/lib/tsconfig.json +13 -13
- package/package.json +86 -87
|
@@ -1,503 +1,503 @@
|
|
|
1
|
-
//
|
|
2
|
-
// STACK OVERFLOW
|
|
3
|
-
// PROSE
|
|
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
|
|
11
|
-
// ----------------------------------------------------------------------------
|
|
12
|
-
|
|
13
|
-
.s-prose {
|
|
14
|
-
--s-prose-line-height: 1.5;
|
|
15
|
-
--s-prose-spacing: 1.1em;
|
|
16
|
-
--s-prose-spacing-condensed: calc(var(--s-prose-spacing) / 2); // Reduce the base spacing by half in the context of lists, etc.
|
|
17
|
-
|
|
18
|
-
// Base styling
|
|
19
|
-
font-size: 15px; // Force a font size that doesn’t change at the smallest breakpoint
|
|
20
|
-
line-height: var(--s-prose-line-height);
|
|
21
|
-
word-wrap: break-word;
|
|
22
|
-
|
|
23
|
-
p {
|
|
24
|
-
margin-bottom: var(--s-prose-spacing);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
pre {
|
|
28
|
-
word-wrap: normal;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
code {
|
|
32
|
-
font-size: var(--fs-body1);
|
|
33
|
-
font-family: var(--ff-mono);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
sub,
|
|
37
|
-
sup {
|
|
38
|
-
code {
|
|
39
|
-
font-size: 90%;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
hr {
|
|
44
|
-
border: 0;
|
|
45
|
-
color: var(--black-100);
|
|
46
|
-
background-color: var(--black-100);
|
|
47
|
-
height: 1px;
|
|
48
|
-
margin-bottom: var(--s-prose-spacing);
|
|
49
|
-
|
|
50
|
-
.highcontrast-mode({
|
|
51
|
-
color: var(--black-500);
|
|
52
|
-
background-color: var(--black-500);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
li {
|
|
57
|
-
word-wrap: break-word;
|
|
58
|
-
|
|
59
|
-
pre {
|
|
60
|
-
word-wrap: normal;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
p,
|
|
65
|
-
dl,
|
|
66
|
-
blockquote,
|
|
67
|
-
table,
|
|
68
|
-
.s-table-container,
|
|
69
|
-
.s-link-preview,
|
|
70
|
-
hr,
|
|
71
|
-
ol,
|
|
72
|
-
ul,
|
|
73
|
-
img,
|
|
74
|
-
pre,
|
|
75
|
-
h1,
|
|
76
|
-
h2,
|
|
77
|
-
h3,
|
|
78
|
-
h4,
|
|
79
|
-
h5,
|
|
80
|
-
h6 {
|
|
81
|
-
&:last-child,
|
|
82
|
-
&:only-child {
|
|
83
|
-
margin-bottom: 0;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// ============================================================================
|
|
88
|
-
// $ HEADERS
|
|
89
|
-
// ----------------------------------------------------------------------------
|
|
90
|
-
h1,
|
|
91
|
-
h2,
|
|
92
|
-
h3,
|
|
93
|
-
h4,
|
|
94
|
-
h5,
|
|
95
|
-
h6 {
|
|
96
|
-
font-weight: bold !important;
|
|
97
|
-
margin-bottom: 0.5em;
|
|
98
|
-
|
|
99
|
-
code {
|
|
100
|
-
font-size: 0.9em;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
h1 {
|
|
105
|
-
font-size: var(--fs-headline1);
|
|
106
|
-
margin-bottom: 0.6em;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
h2 {
|
|
110
|
-
font-size: var(--fs-title);
|
|
111
|
-
margin-bottom: 0.7em;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
h3 {
|
|
115
|
-
font-size: var(--fs-subheading);
|
|
116
|
-
margin-bottom: 0.74em;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
h4 {
|
|
120
|
-
font-size: var(--fs-body3);
|
|
121
|
-
margin-bottom: 1em;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
h5 {
|
|
125
|
-
font-size: var(--fs-body2);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
h6 {
|
|
129
|
-
font-size: var(--fs-body1);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
img,
|
|
133
|
-
dl,
|
|
134
|
-
p,
|
|
135
|
-
pre,
|
|
136
|
-
blockquote,
|
|
137
|
-
table,
|
|
138
|
-
.s-table-container,
|
|
139
|
-
.s-link-preview,
|
|
140
|
-
dd,
|
|
141
|
-
ul,
|
|
142
|
-
ol {
|
|
143
|
-
& + h1 {
|
|
144
|
-
margin-top: 1.5667em;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
& + h2 {
|
|
148
|
-
margin-top: 1.667em;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
& + h3 {
|
|
152
|
-
margin-top: 1.4667em;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
& + h4,
|
|
156
|
-
& + h5,
|
|
157
|
-
& + h6 {
|
|
158
|
-
margin-top: 1.6667em;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// ============================================================================
|
|
163
|
-
// $ IMAGES
|
|
164
|
-
// ----------------------------------------------------------------------------
|
|
165
|
-
img {
|
|
166
|
-
max-width: 100%;
|
|
167
|
-
margin-bottom: var(--s-prose-spacing);
|
|
168
|
-
vertical-align: bottom;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
blockquote,
|
|
172
|
-
li,
|
|
173
|
-
p {
|
|
174
|
-
img {
|
|
175
|
-
margin-bottom: 0;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// ============================================================================
|
|
180
|
-
// $ LISTS
|
|
181
|
-
// ----------------------------------------------------------------------------
|
|
182
|
-
ol,
|
|
183
|
-
ul {
|
|
184
|
-
margin-top: 0;
|
|
185
|
-
margin-bottom: var(--s-prose-spacing);
|
|
186
|
-
|
|
187
|
-
p,
|
|
188
|
-
dl,
|
|
189
|
-
blockquote,
|
|
190
|
-
table,
|
|
191
|
-
hr,
|
|
192
|
-
ol,
|
|
193
|
-
ul {
|
|
194
|
-
&:last-child,
|
|
195
|
-
&:only-child {
|
|
196
|
-
margin-bottom: 0;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// Within lists, we shouldn't have so much spacing
|
|
201
|
-
// in between block-level elements.
|
|
202
|
-
dl,
|
|
203
|
-
p,
|
|
204
|
-
blockquote,
|
|
205
|
-
table,
|
|
206
|
-
hr,
|
|
207
|
-
dd,
|
|
208
|
-
ul,
|
|
209
|
-
ol {
|
|
210
|
-
margin-bottom: var(--s-prose-spacing-condensed);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
pre {
|
|
214
|
-
// Add some more spacing on the bottom
|
|
215
|
-
// For a little extra optical alignment
|
|
216
|
-
margin-bottom: calc(var(--s-prose-spacing-condensed) + 0.1em);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
ol li,
|
|
221
|
-
ul li {
|
|
222
|
-
margin-bottom: var(--s-prose-spacing-condensed);
|
|
223
|
-
|
|
224
|
-
&:last-child {
|
|
225
|
-
margin-bottom: 0;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
li {
|
|
230
|
-
> ul,
|
|
231
|
-
> ol {
|
|
232
|
-
margin-top: var(--s-prose-spacing-condensed);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// ============================================================================
|
|
237
|
-
// $ TABLES
|
|
238
|
-
// ----------------------------------------------------------------------------
|
|
239
|
-
.s-table-container {
|
|
240
|
-
margin-bottom: var(--s-prose-spacing);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// ============================================================================
|
|
244
|
-
// $ LINK PREVIEWS
|
|
245
|
-
// ----------------------------------------------------------------------------
|
|
246
|
-
.s-link-preview {
|
|
247
|
-
margin-bottom: var(--s-prose-spacing);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// ============================================================================
|
|
251
|
-
// $ DEFINITION LISTS
|
|
252
|
-
// ----------------------------------------------------------------------------
|
|
253
|
-
dl {
|
|
254
|
-
margin-top: 0;
|
|
255
|
-
margin-bottom: var(--s-prose-spacing);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
dt {
|
|
259
|
-
font-weight: bold;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
dd {
|
|
263
|
-
margin: 0;
|
|
264
|
-
margin-bottom: var(--s-prose-spacing);
|
|
265
|
-
padding: 0;
|
|
266
|
-
|
|
267
|
-
&:last-child {
|
|
268
|
-
margin-bottom: 0;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// The outer div enforces a max-width of 640px. The inner div has a height of 35 pixels, and a
|
|
273
|
-
// padding-bottom of 56.25%. Padding percentages, even for top/bottom, are always relative
|
|
274
|
-
// to the *width*, so the padding always has an aspect ratio of 1/0.5625, or 16/9. Thus in total,
|
|
275
|
-
// the iframe has a height of 35 + width * 9/16. 35 pixels is the height of youtube's player controls,
|
|
276
|
-
// so we have exactly the space we need for video + controls. The iframe is positioned absolutely
|
|
277
|
-
// because only in that case does the containing block include the padding. The inner div exists
|
|
278
|
-
// because without it you couldn't correctly handle max-width (as there obviously isn't a max-padding-bottom).
|
|
279
|
-
.youtube-embed {
|
|
280
|
-
width: 100%;
|
|
281
|
-
max-width: 640px;
|
|
282
|
-
position: relative;
|
|
283
|
-
|
|
284
|
-
> div {
|
|
285
|
-
width: 100%;
|
|
286
|
-
height: 35px;
|
|
287
|
-
padding-bottom: 56.25%;
|
|
288
|
-
position: relative;
|
|
289
|
-
|
|
290
|
-
iframe {
|
|
291
|
-
position: absolute;
|
|
292
|
-
width: 100%;
|
|
293
|
-
height: 100%;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.soundcloud-embed iframe {
|
|
299
|
-
width: 100%;
|
|
300
|
-
max-width: 640px;
|
|
301
|
-
height: 116px;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
// ============================================================================
|
|
305
|
-
// $ BLOCKQUOTES
|
|
306
|
-
// ----------------------------------------------------------------------------
|
|
307
|
-
blockquote,
|
|
308
|
-
q {
|
|
309
|
-
quotes: none;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
blockquote {
|
|
313
|
-
position: relative;
|
|
314
|
-
margin: 0 1em var(--s-prose-spacing) 1em;
|
|
315
|
-
padding: 0.8em 0.8em 0.8em 1em;
|
|
316
|
-
color: var(--black-600);
|
|
317
|
-
|
|
318
|
-
&:before {
|
|
319
|
-
content: "";
|
|
320
|
-
display: block;
|
|
321
|
-
position: absolute;
|
|
322
|
-
top: 0;
|
|
323
|
-
bottom: 0;
|
|
324
|
-
left: 0;
|
|
325
|
-
width: var(--su4);
|
|
326
|
-
border-radius: var(--su-static8);
|
|
327
|
-
background: var(--black-150);
|
|
328
|
-
|
|
329
|
-
.highcontrast-mode({
|
|
330
|
-
background: var(--black-600);
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
blockquote {
|
|
335
|
-
margin-left: 0; // We don't need the intial indentation on nested blockquotes
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
* {
|
|
339
|
-
&:last-child { margin-bottom: 0; }
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
// Blockquotes inside list
|
|
344
|
-
li {
|
|
345
|
-
blockquote {
|
|
346
|
-
margin-top: var(--s-prose-spacing-condensed);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// ============================================================================
|
|
351
|
-
// $ SPOILERS
|
|
352
|
-
// ----------------------------------------------------------------------------
|
|
353
|
-
.spoiler {
|
|
354
|
-
background: var(--black-050);
|
|
355
|
-
border-radius: var(--br-md);
|
|
356
|
-
color: var(--black-800);
|
|
357
|
-
cursor: pointer;
|
|
358
|
-
min-height: var(--su-static48); // TODO: Let's find a solution that doesn't have a magic number
|
|
359
|
-
|
|
360
|
-
> * {
|
|
361
|
-
visibility: hidden; // hidden elements don't respond to mouse events, but still retain their space
|
|
362
|
-
opacity: 0;
|
|
363
|
-
transition: opacity 0.1s ease-in-out;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
&.is-visible {
|
|
367
|
-
cursor: auto;
|
|
368
|
-
|
|
369
|
-
> * {
|
|
370
|
-
visibility: visible;
|
|
371
|
-
opacity: 1;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
&:after {
|
|
375
|
-
opacity: 0;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
&:after {
|
|
380
|
-
content: attr(data-spoiler) " ";
|
|
381
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' fill='rgb(132, 141, 149)' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M9 17A8 8 0 119 1a8 8 0 010 16zM8 4v6h2V4H8zm0 8v2h2v-2H8z'%3E%3C/path%3E%3C/svg%3E");
|
|
382
|
-
background-repeat: no-repeat;
|
|
383
|
-
background-position: center right;
|
|
384
|
-
font-size: var(--fs-body1);
|
|
385
|
-
color: var(--black-500);
|
|
386
|
-
padding-right: 22px;
|
|
387
|
-
position: absolute;
|
|
388
|
-
top: 1em;
|
|
389
|
-
right: 1em;
|
|
390
|
-
transition: opacity 0.1s ease-in-out;
|
|
391
|
-
pointer-events: none;
|
|
392
|
-
|
|
393
|
-
#stacks-internals #screen-sm({
|
|
394
|
-
top: 9px; // Adjust the position in the smallest breakpoint
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// ============================================================================
|
|
400
|
-
// $ KEYBOARD
|
|
401
|
-
// ----------------------------------------------------------------------------
|
|
402
|
-
kbd {
|
|
403
|
-
display: inline-block;
|
|
404
|
-
margin: 0 0.1em;
|
|
405
|
-
padding: 0.1em 0.6em;
|
|
406
|
-
font-family: var(--ff-sans);
|
|
407
|
-
font-size: var(--fs-fine);
|
|
408
|
-
line-height: var(--s-prose-line-height);
|
|
409
|
-
color: var(--black-800);
|
|
410
|
-
text-shadow: 0 1px 0 var(--white);
|
|
411
|
-
background-color: var(--black-075);
|
|
412
|
-
border: 1px solid var(--black-300);
|
|
413
|
-
border-radius: var(--br-sm);
|
|
414
|
-
box-shadow: 0 1px 1px hsla(210, 8%, 5%, 0.15), inset 0 1px 0 0 @white;
|
|
415
|
-
overflow-wrap: break-word;
|
|
416
|
-
|
|
417
|
-
.dark-mode({
|
|
418
|
-
box-shadow: 0 1px 1px hsla(210, 8%, 5%, 0.8);
|
|
419
|
-
border-color: transparent;
|
|
420
|
-
border-top-color: @black-500;
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// ============================================================================
|
|
425
|
-
// $ CODE STYLES
|
|
426
|
-
// ----------------------------------------------------------------------------
|
|
427
|
-
*:not(.s-code-block) > code {
|
|
428
|
-
padding: var(--su2) var(--su4);
|
|
429
|
-
color: var(--black-800);
|
|
430
|
-
background-color: var(--black-075);
|
|
431
|
-
border-radius: var(--br-sm);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// When contained within a link, we want the code to be link-colored
|
|
435
|
-
*:not(.s-code-block) > a code {
|
|
436
|
-
color: var(--theme-link-color);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
pre {
|
|
440
|
-
margin-top: 0;
|
|
441
|
-
margin-bottom: calc(var(--s-prose-spacing) + 0.4em); // Increase this spacing for better optical alignment
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
pre:not(.s-code-block) {
|
|
445
|
-
padding: var(--su12);
|
|
446
|
-
color: var(--highlight-color);
|
|
447
|
-
width: auto;
|
|
448
|
-
max-height: 600px;
|
|
449
|
-
overflow: auto;
|
|
450
|
-
font-size: var(--fs-body1);
|
|
451
|
-
line-height: var(--lh-md);
|
|
452
|
-
background-color: var(--highlight-bg);
|
|
453
|
-
border-radius: var(--br-md);
|
|
454
|
-
|
|
455
|
-
// Reset the code element when contained within a <pre>
|
|
456
|
-
code {
|
|
457
|
-
background-color: transparent;
|
|
458
|
-
padding: 0;
|
|
459
|
-
border-radius: 0;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
@scrollbar-styles();
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
&.s-prose__xs {
|
|
466
|
-
font-size: var(--fs-caption);
|
|
467
|
-
line-height: var(--lh-sm);
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
&.s-prose__sm {
|
|
471
|
-
font-size: var(--fs-body1);
|
|
472
|
-
line-height: var(--lh-md);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
&.s-prose__md {
|
|
476
|
-
font-size: var(--fs-body3);
|
|
477
|
-
line-height: var(--lh-xl);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
&.s-prose__xs,
|
|
481
|
-
&.s-prose__sm,
|
|
482
|
-
&.s-prose__md {
|
|
483
|
-
h1 {
|
|
484
|
-
font-size: var(--fs-headline1-relative);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
h2 {
|
|
488
|
-
font-size: var(--fs-title-relative);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
h3 {
|
|
492
|
-
font-size: var(--fs-subheading-relative);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
h4 {
|
|
496
|
-
font-size: var(--fs-body3-relative);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
h5 {
|
|
500
|
-
font-size: var(--fs-body2-relative);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
1
|
+
//
|
|
2
|
+
// STACK OVERFLOW
|
|
3
|
+
// PROSE
|
|
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
|
|
11
|
+
// ----------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
.s-prose {
|
|
14
|
+
--s-prose-line-height: 1.5;
|
|
15
|
+
--s-prose-spacing: 1.1em;
|
|
16
|
+
--s-prose-spacing-condensed: calc(var(--s-prose-spacing) / 2); // Reduce the base spacing by half in the context of lists, etc.
|
|
17
|
+
|
|
18
|
+
// Base styling
|
|
19
|
+
font-size: 15px; // Force a font size that doesn’t change at the smallest breakpoint
|
|
20
|
+
line-height: var(--s-prose-line-height);
|
|
21
|
+
word-wrap: break-word;
|
|
22
|
+
|
|
23
|
+
p {
|
|
24
|
+
margin-bottom: var(--s-prose-spacing);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
pre {
|
|
28
|
+
word-wrap: normal;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
code {
|
|
32
|
+
font-size: var(--fs-body1);
|
|
33
|
+
font-family: var(--ff-mono);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
sub,
|
|
37
|
+
sup {
|
|
38
|
+
code {
|
|
39
|
+
font-size: 90%;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
hr {
|
|
44
|
+
border: 0;
|
|
45
|
+
color: var(--black-100);
|
|
46
|
+
background-color: var(--black-100);
|
|
47
|
+
height: 1px;
|
|
48
|
+
margin-bottom: var(--s-prose-spacing);
|
|
49
|
+
|
|
50
|
+
.highcontrast-mode({
|
|
51
|
+
color: var(--black-500);
|
|
52
|
+
background-color: var(--black-500);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
li {
|
|
57
|
+
word-wrap: break-word;
|
|
58
|
+
|
|
59
|
+
pre {
|
|
60
|
+
word-wrap: normal;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
p,
|
|
65
|
+
dl,
|
|
66
|
+
blockquote,
|
|
67
|
+
table,
|
|
68
|
+
.s-table-container,
|
|
69
|
+
.s-link-preview,
|
|
70
|
+
hr,
|
|
71
|
+
ol,
|
|
72
|
+
ul,
|
|
73
|
+
img,
|
|
74
|
+
pre,
|
|
75
|
+
h1,
|
|
76
|
+
h2,
|
|
77
|
+
h3,
|
|
78
|
+
h4,
|
|
79
|
+
h5,
|
|
80
|
+
h6 {
|
|
81
|
+
&:last-child,
|
|
82
|
+
&:only-child {
|
|
83
|
+
margin-bottom: 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// ============================================================================
|
|
88
|
+
// $ HEADERS
|
|
89
|
+
// ----------------------------------------------------------------------------
|
|
90
|
+
h1,
|
|
91
|
+
h2,
|
|
92
|
+
h3,
|
|
93
|
+
h4,
|
|
94
|
+
h5,
|
|
95
|
+
h6 {
|
|
96
|
+
font-weight: bold !important;
|
|
97
|
+
margin-bottom: 0.5em;
|
|
98
|
+
|
|
99
|
+
code {
|
|
100
|
+
font-size: 0.9em;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
h1 {
|
|
105
|
+
font-size: var(--fs-headline1);
|
|
106
|
+
margin-bottom: 0.6em;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
h2 {
|
|
110
|
+
font-size: var(--fs-title);
|
|
111
|
+
margin-bottom: 0.7em;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
h3 {
|
|
115
|
+
font-size: var(--fs-subheading);
|
|
116
|
+
margin-bottom: 0.74em;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
h4 {
|
|
120
|
+
font-size: var(--fs-body3);
|
|
121
|
+
margin-bottom: 1em;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
h5 {
|
|
125
|
+
font-size: var(--fs-body2);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
h6 {
|
|
129
|
+
font-size: var(--fs-body1);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
img,
|
|
133
|
+
dl,
|
|
134
|
+
p,
|
|
135
|
+
pre,
|
|
136
|
+
blockquote,
|
|
137
|
+
table,
|
|
138
|
+
.s-table-container,
|
|
139
|
+
.s-link-preview,
|
|
140
|
+
dd,
|
|
141
|
+
ul,
|
|
142
|
+
ol {
|
|
143
|
+
& + h1 {
|
|
144
|
+
margin-top: 1.5667em;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
& + h2 {
|
|
148
|
+
margin-top: 1.667em;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
& + h3 {
|
|
152
|
+
margin-top: 1.4667em;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
& + h4,
|
|
156
|
+
& + h5,
|
|
157
|
+
& + h6 {
|
|
158
|
+
margin-top: 1.6667em;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ============================================================================
|
|
163
|
+
// $ IMAGES
|
|
164
|
+
// ----------------------------------------------------------------------------
|
|
165
|
+
img {
|
|
166
|
+
max-width: 100%;
|
|
167
|
+
margin-bottom: var(--s-prose-spacing);
|
|
168
|
+
vertical-align: bottom;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
blockquote,
|
|
172
|
+
li,
|
|
173
|
+
p {
|
|
174
|
+
img {
|
|
175
|
+
margin-bottom: 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ============================================================================
|
|
180
|
+
// $ LISTS
|
|
181
|
+
// ----------------------------------------------------------------------------
|
|
182
|
+
ol,
|
|
183
|
+
ul {
|
|
184
|
+
margin-top: 0;
|
|
185
|
+
margin-bottom: var(--s-prose-spacing);
|
|
186
|
+
|
|
187
|
+
p,
|
|
188
|
+
dl,
|
|
189
|
+
blockquote,
|
|
190
|
+
table,
|
|
191
|
+
hr,
|
|
192
|
+
ol,
|
|
193
|
+
ul {
|
|
194
|
+
&:last-child,
|
|
195
|
+
&:only-child {
|
|
196
|
+
margin-bottom: 0;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Within lists, we shouldn't have so much spacing
|
|
201
|
+
// in between block-level elements.
|
|
202
|
+
dl,
|
|
203
|
+
p,
|
|
204
|
+
blockquote,
|
|
205
|
+
table,
|
|
206
|
+
hr,
|
|
207
|
+
dd,
|
|
208
|
+
ul,
|
|
209
|
+
ol {
|
|
210
|
+
margin-bottom: var(--s-prose-spacing-condensed);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
pre {
|
|
214
|
+
// Add some more spacing on the bottom
|
|
215
|
+
// For a little extra optical alignment
|
|
216
|
+
margin-bottom: calc(var(--s-prose-spacing-condensed) + 0.1em);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
ol li,
|
|
221
|
+
ul li {
|
|
222
|
+
margin-bottom: var(--s-prose-spacing-condensed);
|
|
223
|
+
|
|
224
|
+
&:last-child {
|
|
225
|
+
margin-bottom: 0;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
li {
|
|
230
|
+
> ul,
|
|
231
|
+
> ol {
|
|
232
|
+
margin-top: var(--s-prose-spacing-condensed);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// ============================================================================
|
|
237
|
+
// $ TABLES
|
|
238
|
+
// ----------------------------------------------------------------------------
|
|
239
|
+
.s-table-container {
|
|
240
|
+
margin-bottom: var(--s-prose-spacing);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ============================================================================
|
|
244
|
+
// $ LINK PREVIEWS
|
|
245
|
+
// ----------------------------------------------------------------------------
|
|
246
|
+
.s-link-preview {
|
|
247
|
+
margin-bottom: var(--s-prose-spacing);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// ============================================================================
|
|
251
|
+
// $ DEFINITION LISTS
|
|
252
|
+
// ----------------------------------------------------------------------------
|
|
253
|
+
dl {
|
|
254
|
+
margin-top: 0;
|
|
255
|
+
margin-bottom: var(--s-prose-spacing);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
dt {
|
|
259
|
+
font-weight: bold;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
dd {
|
|
263
|
+
margin: 0;
|
|
264
|
+
margin-bottom: var(--s-prose-spacing);
|
|
265
|
+
padding: 0;
|
|
266
|
+
|
|
267
|
+
&:last-child {
|
|
268
|
+
margin-bottom: 0;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// The outer div enforces a max-width of 640px. The inner div has a height of 35 pixels, and a
|
|
273
|
+
// padding-bottom of 56.25%. Padding percentages, even for top/bottom, are always relative
|
|
274
|
+
// to the *width*, so the padding always has an aspect ratio of 1/0.5625, or 16/9. Thus in total,
|
|
275
|
+
// the iframe has a height of 35 + width * 9/16. 35 pixels is the height of youtube's player controls,
|
|
276
|
+
// so we have exactly the space we need for video + controls. The iframe is positioned absolutely
|
|
277
|
+
// because only in that case does the containing block include the padding. The inner div exists
|
|
278
|
+
// because without it you couldn't correctly handle max-width (as there obviously isn't a max-padding-bottom).
|
|
279
|
+
.youtube-embed {
|
|
280
|
+
width: 100%;
|
|
281
|
+
max-width: 640px;
|
|
282
|
+
position: relative;
|
|
283
|
+
|
|
284
|
+
> div {
|
|
285
|
+
width: 100%;
|
|
286
|
+
height: 35px;
|
|
287
|
+
padding-bottom: 56.25%;
|
|
288
|
+
position: relative;
|
|
289
|
+
|
|
290
|
+
iframe {
|
|
291
|
+
position: absolute;
|
|
292
|
+
width: 100%;
|
|
293
|
+
height: 100%;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.soundcloud-embed iframe {
|
|
299
|
+
width: 100%;
|
|
300
|
+
max-width: 640px;
|
|
301
|
+
height: 116px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// ============================================================================
|
|
305
|
+
// $ BLOCKQUOTES
|
|
306
|
+
// ----------------------------------------------------------------------------
|
|
307
|
+
blockquote,
|
|
308
|
+
q {
|
|
309
|
+
quotes: none;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
blockquote {
|
|
313
|
+
position: relative;
|
|
314
|
+
margin: 0 1em var(--s-prose-spacing) 1em;
|
|
315
|
+
padding: 0.8em 0.8em 0.8em 1em;
|
|
316
|
+
color: var(--black-600);
|
|
317
|
+
|
|
318
|
+
&:before {
|
|
319
|
+
content: "";
|
|
320
|
+
display: block;
|
|
321
|
+
position: absolute;
|
|
322
|
+
top: 0;
|
|
323
|
+
bottom: 0;
|
|
324
|
+
left: 0;
|
|
325
|
+
width: var(--su4);
|
|
326
|
+
border-radius: var(--su-static8);
|
|
327
|
+
background: var(--black-150);
|
|
328
|
+
|
|
329
|
+
.highcontrast-mode({
|
|
330
|
+
background: var(--black-600);
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
blockquote {
|
|
335
|
+
margin-left: 0; // We don't need the intial indentation on nested blockquotes
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
* {
|
|
339
|
+
&:last-child { margin-bottom: 0; }
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Blockquotes inside list
|
|
344
|
+
li {
|
|
345
|
+
blockquote {
|
|
346
|
+
margin-top: var(--s-prose-spacing-condensed);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// ============================================================================
|
|
351
|
+
// $ SPOILERS
|
|
352
|
+
// ----------------------------------------------------------------------------
|
|
353
|
+
.spoiler {
|
|
354
|
+
background: var(--black-050);
|
|
355
|
+
border-radius: var(--br-md);
|
|
356
|
+
color: var(--black-800);
|
|
357
|
+
cursor: pointer;
|
|
358
|
+
min-height: var(--su-static48); // TODO: Let's find a solution that doesn't have a magic number
|
|
359
|
+
|
|
360
|
+
> * {
|
|
361
|
+
visibility: hidden; // hidden elements don't respond to mouse events, but still retain their space
|
|
362
|
+
opacity: 0;
|
|
363
|
+
transition: opacity 0.1s ease-in-out;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
&.is-visible {
|
|
367
|
+
cursor: auto;
|
|
368
|
+
|
|
369
|
+
> * {
|
|
370
|
+
visibility: visible;
|
|
371
|
+
opacity: 1;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
&:after {
|
|
375
|
+
opacity: 0;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
&:after {
|
|
380
|
+
content: attr(data-spoiler) " ";
|
|
381
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' fill='rgb(132, 141, 149)' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M9 17A8 8 0 119 1a8 8 0 010 16zM8 4v6h2V4H8zm0 8v2h2v-2H8z'%3E%3C/path%3E%3C/svg%3E");
|
|
382
|
+
background-repeat: no-repeat;
|
|
383
|
+
background-position: center right;
|
|
384
|
+
font-size: var(--fs-body1);
|
|
385
|
+
color: var(--black-500);
|
|
386
|
+
padding-right: 22px;
|
|
387
|
+
position: absolute;
|
|
388
|
+
top: 1em;
|
|
389
|
+
right: 1em;
|
|
390
|
+
transition: opacity 0.1s ease-in-out;
|
|
391
|
+
pointer-events: none;
|
|
392
|
+
|
|
393
|
+
#stacks-internals #screen-sm({
|
|
394
|
+
top: 9px; // Adjust the position in the smallest breakpoint
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// ============================================================================
|
|
400
|
+
// $ KEYBOARD
|
|
401
|
+
// ----------------------------------------------------------------------------
|
|
402
|
+
kbd {
|
|
403
|
+
display: inline-block;
|
|
404
|
+
margin: 0 0.1em;
|
|
405
|
+
padding: 0.1em 0.6em;
|
|
406
|
+
font-family: var(--ff-sans);
|
|
407
|
+
font-size: var(--fs-fine);
|
|
408
|
+
line-height: var(--s-prose-line-height);
|
|
409
|
+
color: var(--black-800);
|
|
410
|
+
text-shadow: 0 1px 0 var(--white);
|
|
411
|
+
background-color: var(--black-075);
|
|
412
|
+
border: 1px solid var(--black-300);
|
|
413
|
+
border-radius: var(--br-sm);
|
|
414
|
+
box-shadow: 0 1px 1px hsla(210, 8%, 5%, 0.15), inset 0 1px 0 0 @white;
|
|
415
|
+
overflow-wrap: break-word;
|
|
416
|
+
|
|
417
|
+
.dark-mode({
|
|
418
|
+
box-shadow: 0 1px 1px hsla(210, 8%, 5%, 0.8);
|
|
419
|
+
border-color: transparent;
|
|
420
|
+
border-top-color: @black-500;
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// ============================================================================
|
|
425
|
+
// $ CODE STYLES
|
|
426
|
+
// ----------------------------------------------------------------------------
|
|
427
|
+
*:not(.s-code-block) > code {
|
|
428
|
+
padding: var(--su2) var(--su4);
|
|
429
|
+
color: var(--black-800);
|
|
430
|
+
background-color: var(--black-075);
|
|
431
|
+
border-radius: var(--br-sm);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// When contained within a link, we want the code to be link-colored
|
|
435
|
+
*:not(.s-code-block) > a code {
|
|
436
|
+
color: var(--theme-link-color);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
pre {
|
|
440
|
+
margin-top: 0;
|
|
441
|
+
margin-bottom: calc(var(--s-prose-spacing) + 0.4em); // Increase this spacing for better optical alignment
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
pre:not(.s-code-block) {
|
|
445
|
+
padding: var(--su12);
|
|
446
|
+
color: var(--highlight-color);
|
|
447
|
+
width: auto;
|
|
448
|
+
max-height: 600px;
|
|
449
|
+
overflow: auto;
|
|
450
|
+
font-size: var(--fs-body1);
|
|
451
|
+
line-height: var(--lh-md);
|
|
452
|
+
background-color: var(--highlight-bg);
|
|
453
|
+
border-radius: var(--br-md);
|
|
454
|
+
|
|
455
|
+
// Reset the code element when contained within a <pre>
|
|
456
|
+
code {
|
|
457
|
+
background-color: transparent;
|
|
458
|
+
padding: 0;
|
|
459
|
+
border-radius: 0;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
@scrollbar-styles();
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
&.s-prose__xs {
|
|
466
|
+
font-size: var(--fs-caption);
|
|
467
|
+
line-height: var(--lh-sm);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
&.s-prose__sm {
|
|
471
|
+
font-size: var(--fs-body1);
|
|
472
|
+
line-height: var(--lh-md);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
&.s-prose__md {
|
|
476
|
+
font-size: var(--fs-body3);
|
|
477
|
+
line-height: var(--lh-xl);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
&.s-prose__xs,
|
|
481
|
+
&.s-prose__sm,
|
|
482
|
+
&.s-prose__md {
|
|
483
|
+
h1 {
|
|
484
|
+
font-size: var(--fs-headline1-relative);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
h2 {
|
|
488
|
+
font-size: var(--fs-title-relative);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
h3 {
|
|
492
|
+
font-size: var(--fs-subheading-relative);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
h4 {
|
|
496
|
+
font-size: var(--fs-body3-relative);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
h5 {
|
|
500
|
+
font-size: var(--fs-body2-relative);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|