@frontfactory/vitepress-theme 1.0.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/LICENSE.md +21 -0
- package/README.md +260 -0
- package/config.d.ts +6 -0
- package/config.js +54 -0
- package/dist/style.css +1709 -0
- package/package.json +84 -0
- package/src/components/FfBackToTop.vue +50 -0
- package/src/components/FfBanner.vue +74 -0
- package/src/components/FfDocMeta.vue +112 -0
- package/src/components/FfFeature.vue +44 -0
- package/src/components/FfFooter.vue +40 -0
- package/src/components/FfHero.vue +171 -0
- package/src/composables/options.ts +48 -0
- package/src/content/Api.vue +32 -0
- package/src/content/Card.vue +31 -0
- package/src/content/CardGrid.vue +9 -0
- package/src/content/Kbd.vue +3 -0
- package/src/content/Steps.vue +5 -0
- package/src/index.ts +52 -0
- package/src/internal.ts +10 -0
- package/src/layout/FfLayout.vue +41 -0
- package/src/styles/_base.scss +121 -0
- package/src/styles/_blocks.scss +103 -0
- package/src/styles/_code.scss +163 -0
- package/src/styles/_content.scss +374 -0
- package/src/styles/_doc.scss +416 -0
- package/src/styles/_home.scss +429 -0
- package/src/styles/_motion.scss +231 -0
- package/src/styles/_nav.scss +224 -0
- package/src/styles/_sidebar.scss +127 -0
- package/src/styles/_theme.scss +8 -0
- package/src/styles/_tokens.scss +235 -0
- package/src/styles/index.scss +19 -0
- package/src/types.ts +96 -0
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
// ============================================================================================= //
|
|
2
|
+
// DOCUMENT //
|
|
3
|
+
// ============================================================================================= //
|
|
4
|
+
|
|
5
|
+
@use "theme" as mg;
|
|
6
|
+
|
|
7
|
+
// The frame: the band every page lives in.
|
|
8
|
+
//
|
|
9
|
+
// The default theme only centres the doc layout from 1440px up, and on a different width than the
|
|
10
|
+
// home. Applying one band from 960px up is what keeps the sidebar, the text column, the outline and
|
|
11
|
+
// the home content on the same two vertical lines.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
.ff-theme {
|
|
16
|
+
@media (min-width: 960px) {
|
|
17
|
+
.VPSidebar {
|
|
18
|
+
padding-left: var(--ff-frame);
|
|
19
|
+
width: calc(var(--ff-frame) + var(--vp-sidebar-width));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.VPContent.has-sidebar {
|
|
23
|
+
padding-right: var(--ff-frame);
|
|
24
|
+
padding-left: calc(var(--ff-frame) + var(--vp-sidebar-width));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// The band is carried by the content wrapper, so the document itself adds no gutter.
|
|
28
|
+
|
|
29
|
+
.VPDoc.has-sidebar {
|
|
30
|
+
padding-right: 0;
|
|
31
|
+
padding-left: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.VPLocalNav.has-sidebar {
|
|
35
|
+
padding-left: calc(var(--ff-frame) + var(--vp-sidebar-width));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// The outline lives in a container of a fixed width, so the column that holds it must never be
|
|
40
|
+
// squeezed by the text: it would spill out of the band, past the bar above it.
|
|
41
|
+
|
|
42
|
+
@media (min-width: 1280px) {
|
|
43
|
+
.VPDoc .aside {
|
|
44
|
+
flex: 0 0 auto;
|
|
45
|
+
width: 16rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.VPDoc .content {
|
|
49
|
+
min-width: 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ----------------------------------------------------------------------------------------- //
|
|
54
|
+
// Measure
|
|
55
|
+
// ----------------------------------------------------------------------------------------- //
|
|
56
|
+
|
|
57
|
+
.VPDoc .container {
|
|
58
|
+
max-width: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.VPDoc.has-aside .content-container,
|
|
62
|
+
.VPDoc .content-container {
|
|
63
|
+
max-width: #{mg.ref("layout-content")};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.VPDoc:not(.has-sidebar) .content {
|
|
67
|
+
max-width: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ----------------------------------------------------------------------------------------- //
|
|
71
|
+
// Headings
|
|
72
|
+
// ----------------------------------------------------------------------------------------- //
|
|
73
|
+
|
|
74
|
+
.vp-doc h1,
|
|
75
|
+
.vp-doc h2,
|
|
76
|
+
.vp-doc h3,
|
|
77
|
+
.vp-doc h4 {
|
|
78
|
+
font-family: #{mg.ref("font-display")};
|
|
79
|
+
letter-spacing: #{mg.ref("tracking-display")};
|
|
80
|
+
font-variation-settings: "opsz" 32;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.vp-doc h1 {
|
|
84
|
+
margin: 0 0 1.25rem;
|
|
85
|
+
font-size: #{mg.ref("size-h1")};
|
|
86
|
+
font-weight: 620;
|
|
87
|
+
line-height: #{mg.ref("leading-tight")};
|
|
88
|
+
letter-spacing: -0.03em;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.vp-doc h2 {
|
|
92
|
+
// The gap between the section rule and the heading. The anchor hangs off the same value —
|
|
93
|
+
// the default theme sets its own `top` to match its own padding, and this theme changes
|
|
94
|
+
// that padding, so the two have to be declared once and read twice.
|
|
95
|
+
--ff-h2-rule-gap: 1.75rem;
|
|
96
|
+
|
|
97
|
+
margin: 3.5rem 0 1.25rem;
|
|
98
|
+
padding-top: var(--ff-h2-rule-gap);
|
|
99
|
+
border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
100
|
+
|
|
101
|
+
// The section rule fades out to the right rather than cutting the page in two.
|
|
102
|
+
border-image: linear-gradient(
|
|
103
|
+
90deg,
|
|
104
|
+
#{mg.ref("color-rule-strong")},
|
|
105
|
+
transparent 85%
|
|
106
|
+
)
|
|
107
|
+
1;
|
|
108
|
+
font-size: #{mg.ref("size-h2")};
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
line-height: 1.3;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.vp-doc h3 {
|
|
114
|
+
margin: 2.5rem 0 0.75rem;
|
|
115
|
+
font-size: #{mg.ref("size-h3")};
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
letter-spacing: -0.015em;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.vp-doc h4 {
|
|
121
|
+
margin: 2rem 0 0.5rem;
|
|
122
|
+
font-size: 1rem;
|
|
123
|
+
font-weight: 600;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Anchors live in the margin, out of the reading line.
|
|
127
|
+
|
|
128
|
+
.vp-doc .header-anchor {
|
|
129
|
+
left: -1.5rem;
|
|
130
|
+
margin-left: 0;
|
|
131
|
+
font-family: #{mg.ref("font-mono")};
|
|
132
|
+
font-weight: 400;
|
|
133
|
+
color: #{mg.ref("color-ink-faint")};
|
|
134
|
+
opacity: 0;
|
|
135
|
+
transition: opacity #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.vp-doc h2 .header-anchor {
|
|
139
|
+
top: var(--ff-h2-rule-gap);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.vp-doc h1:hover .header-anchor,
|
|
143
|
+
.vp-doc h2:hover .header-anchor,
|
|
144
|
+
.vp-doc h3:hover .header-anchor,
|
|
145
|
+
.vp-doc h4:hover .header-anchor,
|
|
146
|
+
.vp-doc .header-anchor:focus {
|
|
147
|
+
opacity: 1;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ----------------------------------------------------------------------------------------- //
|
|
151
|
+
// Copy
|
|
152
|
+
// ----------------------------------------------------------------------------------------- //
|
|
153
|
+
|
|
154
|
+
.vp-doc p,
|
|
155
|
+
.vp-doc li {
|
|
156
|
+
line-height: #{mg.ref("leading-body")};
|
|
157
|
+
color: #{mg.ref("color-ink")};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.vp-doc p {
|
|
161
|
+
margin: 1.25rem 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Standfirst: the paragraph right under the page title carries the summary.
|
|
165
|
+
|
|
166
|
+
.vp-doc > div > h1 + p {
|
|
167
|
+
margin-top: 1.5rem;
|
|
168
|
+
font-size: #{mg.ref("size-body")};
|
|
169
|
+
line-height: 1.65;
|
|
170
|
+
color: #{mg.ref("color-ink-muted")};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.vp-doc a {
|
|
174
|
+
font-weight: inherit;
|
|
175
|
+
color: #{mg.ref("color-accent")};
|
|
176
|
+
text-decoration-thickness: 1px;
|
|
177
|
+
text-underline-offset: 0.2em;
|
|
178
|
+
text-decoration-color: #{mg.ref("color-accent-soft")};
|
|
179
|
+
transition: text-decoration-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.vp-doc a:hover {
|
|
183
|
+
text-decoration-color: currentcolor;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.vp-doc strong {
|
|
187
|
+
font-weight: 620;
|
|
188
|
+
color: #{mg.ref("color-ink")};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.vp-doc blockquote {
|
|
192
|
+
margin: 1.75rem 0;
|
|
193
|
+
padding-left: 1.25rem;
|
|
194
|
+
border-left: #{mg.ref("rule-accent-width")} solid #{mg.ref("color-rule-strong")};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.vp-doc blockquote > p {
|
|
198
|
+
font-size: 1rem;
|
|
199
|
+
font-style: italic;
|
|
200
|
+
color: #{mg.ref("color-ink-muted")};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.vp-doc hr {
|
|
204
|
+
margin: 3rem 0;
|
|
205
|
+
border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.vp-doc :not(pre) > code {
|
|
209
|
+
padding: 0.15em 0.35em;
|
|
210
|
+
border-radius: #{mg.ref("radius-sm")};
|
|
211
|
+
background: #{mg.ref("color-surface-alt")};
|
|
212
|
+
font-size: 0.8125em;
|
|
213
|
+
color: #{mg.ref("color-ink")};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.vp-doc a > code {
|
|
217
|
+
color: #{mg.ref("color-accent")};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// A heading that names a symbol keeps the monospaced face but loses the fill — it is a title,
|
|
221
|
+
// not an inline mention.
|
|
222
|
+
|
|
223
|
+
.vp-doc h1 code,
|
|
224
|
+
.vp-doc h2 code,
|
|
225
|
+
.vp-doc h3 code,
|
|
226
|
+
.vp-doc h4 code {
|
|
227
|
+
padding: 0;
|
|
228
|
+
border-radius: 0;
|
|
229
|
+
background: transparent;
|
|
230
|
+
font-size: 0.9em;
|
|
231
|
+
font-weight: 600;
|
|
232
|
+
color: inherit;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ----------------------------------------------------------------------------------------- //
|
|
236
|
+
// Tables: ruled, never boxed
|
|
237
|
+
// ----------------------------------------------------------------------------------------- //
|
|
238
|
+
|
|
239
|
+
.vp-doc table {
|
|
240
|
+
display: table;
|
|
241
|
+
width: 100%;
|
|
242
|
+
margin: 1.75rem 0;
|
|
243
|
+
border-collapse: collapse;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.vp-doc tr {
|
|
247
|
+
border: 0;
|
|
248
|
+
background: transparent;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.vp-doc th {
|
|
252
|
+
padding: 0.5rem 0.875rem 0.5rem 0;
|
|
253
|
+
border: 0;
|
|
254
|
+
border-bottom: #{mg.ref("rule-width")} solid #{mg.ref("color-rule-strong")};
|
|
255
|
+
background: transparent;
|
|
256
|
+
font-family: #{mg.ref("font-mono")};
|
|
257
|
+
font-size: #{mg.ref("size-label")};
|
|
258
|
+
font-weight: 500;
|
|
259
|
+
text-align: left;
|
|
260
|
+
text-transform: uppercase;
|
|
261
|
+
letter-spacing: #{mg.ref("tracking-label")};
|
|
262
|
+
color: #{mg.ref("color-ink-faint")};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.vp-doc td {
|
|
266
|
+
padding: 0.75rem 0.875rem 0.75rem 0;
|
|
267
|
+
border: 0;
|
|
268
|
+
border-bottom: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
269
|
+
font-size: 0.9375rem;
|
|
270
|
+
line-height: 1.6;
|
|
271
|
+
vertical-align: top;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.vp-doc th:last-child,
|
|
275
|
+
.vp-doc td:last-child {
|
|
276
|
+
padding-right: 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.vp-doc img {
|
|
280
|
+
border-radius: #{mg.ref("radius-md")};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ----------------------------------------------------------------------------------------- //
|
|
284
|
+
// Page footer
|
|
285
|
+
// ----------------------------------------------------------------------------------------- //
|
|
286
|
+
|
|
287
|
+
.VPDocFooter {
|
|
288
|
+
margin-top: 3.5rem;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.VPDocFooter .edit-info {
|
|
292
|
+
padding-bottom: 1.25rem;
|
|
293
|
+
border-bottom: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.VPDocFooter .edit-link-button,
|
|
297
|
+
.VPDocFooter .last-updated {
|
|
298
|
+
font-family: #{mg.ref("font-mono")};
|
|
299
|
+
font-size: #{mg.ref("size-meta")};
|
|
300
|
+
font-weight: 400;
|
|
301
|
+
color: #{mg.ref("color-ink-faint")};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.VPDocFooter .edit-link-button {
|
|
305
|
+
color: #{mg.ref("color-accent")};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.VPDocFooter .prev-next {
|
|
309
|
+
margin-top: 0;
|
|
310
|
+
padding-top: 0;
|
|
311
|
+
border-top: 0;
|
|
312
|
+
gap: 0;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// The pager answers in colour: the rule under it and its label take the accent, nothing fills
|
|
316
|
+
// and nothing moves.
|
|
317
|
+
|
|
318
|
+
.VPDocFooter .pager-link {
|
|
319
|
+
padding: 1.5rem 0;
|
|
320
|
+
border: 0;
|
|
321
|
+
border-bottom: #{mg.ref("rule-accent-width")} solid #{mg.ref("color-rule")};
|
|
322
|
+
border-radius: 0;
|
|
323
|
+
background: transparent;
|
|
324
|
+
transition: border-color #{mg.ref("motion-duration-slow")} #{mg.ref("motion-ease")};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.VPDocFooter .pager-link:hover {
|
|
328
|
+
border-bottom-color: #{mg.ref("color-accent")};
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.VPDocFooter .pager-link .desc {
|
|
332
|
+
font-family: #{mg.ref("font-mono")};
|
|
333
|
+
font-size: #{mg.ref("size-label")};
|
|
334
|
+
font-weight: 500;
|
|
335
|
+
text-transform: uppercase;
|
|
336
|
+
letter-spacing: #{mg.ref("tracking-label")};
|
|
337
|
+
color: #{mg.ref("color-ink-faint")};
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.VPDocFooter .pager-link .title {
|
|
341
|
+
font-family: #{mg.ref("font-display")};
|
|
342
|
+
font-size: 1.0625rem;
|
|
343
|
+
font-weight: 600;
|
|
344
|
+
letter-spacing: -0.015em;
|
|
345
|
+
color: #{mg.ref("color-ink")};
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.VPDocFooter .pager-link .desc,
|
|
349
|
+
.VPDocFooter .pager-link .title {
|
|
350
|
+
transition: color #{mg.ref("motion-duration-slow")} #{mg.ref("motion-ease")};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.VPDocFooter .pager-link:hover .desc,
|
|
354
|
+
.VPDocFooter .pager-link:hover .title {
|
|
355
|
+
color: #{mg.ref("color-accent")};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// ----------------------------------------------------------------------------------------- //
|
|
359
|
+
// Outline
|
|
360
|
+
// ----------------------------------------------------------------------------------------- //
|
|
361
|
+
|
|
362
|
+
// The outline reads like the sidebar it faces: same heading treatment, same rhythm, and full
|
|
363
|
+
// titles — API signatures are the whole point of the column and must not be cut off.
|
|
364
|
+
|
|
365
|
+
.VPDocAsideOutline .content {
|
|
366
|
+
padding-left: 1rem;
|
|
367
|
+
border-left: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.VPDocAsideOutline .outline-title {
|
|
371
|
+
margin-bottom: 0.75rem;
|
|
372
|
+
font-family: #{mg.ref("font-mono")};
|
|
373
|
+
font-size: #{mg.ref("size-meta")};
|
|
374
|
+
font-weight: 600;
|
|
375
|
+
line-height: 1.4;
|
|
376
|
+
text-transform: uppercase;
|
|
377
|
+
letter-spacing: 0.08em;
|
|
378
|
+
color: #{mg.ref("color-ink")};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.VPDocAsideOutline .outline-marker {
|
|
382
|
+
width: #{mg.ref("rule-accent-width")};
|
|
383
|
+
border-radius: 0;
|
|
384
|
+
background-color: #{mg.ref("color-accent")};
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.VPDocAsideOutline .outline-link {
|
|
388
|
+
display: block;
|
|
389
|
+
padding: 0.25rem 0;
|
|
390
|
+
font-size: 0.875rem;
|
|
391
|
+
font-weight: 450;
|
|
392
|
+
line-height: 1.5;
|
|
393
|
+
color: #{mg.ref("color-ink-muted")};
|
|
394
|
+
white-space: normal;
|
|
395
|
+
overflow: visible;
|
|
396
|
+
overflow-wrap: break-word;
|
|
397
|
+
transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.VPDocAsideOutline .outline-link:hover {
|
|
401
|
+
color: #{mg.ref("color-ink")};
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.VPDocAsideOutline .outline-link.active {
|
|
405
|
+
font-weight: 600;
|
|
406
|
+
color: #{mg.ref("color-accent")};
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.VPDocAsideOutline .VPDocOutlineItem.nested {
|
|
410
|
+
padding-left: 0.75rem;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.VPDocAsideOutline .VPDocOutlineItem.nested .outline-link {
|
|
414
|
+
font-size: 0.8125rem;
|
|
415
|
+
}
|
|
416
|
+
}
|