@frontfactory/vitepress-theme 1.8.0 → 1.10.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 (59) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +11 -391
  3. package/config.d.ts +4 -3
  4. package/config.js +58 -40
  5. package/dist/style.css +1 -1
  6. package/node/banner.d.ts +3 -0
  7. package/node/banner.js +14 -0
  8. package/node/blog.d.ts +11 -0
  9. package/node/blog.js +63 -0
  10. package/node/llms.js +4 -3
  11. package/node/og.js +5 -6
  12. package/node/options.d.ts +1 -0
  13. package/node/options.js +17 -0
  14. package/node/page-actions.d.ts +12 -0
  15. package/node/page-actions.js +34 -0
  16. package/node/pages.js +34 -14
  17. package/node/rss.js +13 -21
  18. package/package.json +1 -1
  19. package/src/blog/posts.data.ts +7 -4
  20. package/src/components/FfBackToTop.vue +6 -36
  21. package/src/components/FfBanner.vue +3 -2
  22. package/src/components/FfCopyStatus.vue +6 -14
  23. package/src/components/FfDocMeta.vue +299 -24
  24. package/src/components/FfFeedback.vue +4 -9
  25. package/src/components/FfHero.vue +14 -33
  26. package/src/components/FfHeroActions.vue +44 -0
  27. package/src/components/FfHeroCommand.vue +3 -2
  28. package/src/components/FfPost.vue +6 -4
  29. package/src/components/FfProgress.vue +6 -40
  30. package/src/composables/blog.ts +8 -11
  31. package/src/composables/copy.ts +29 -0
  32. package/src/composables/frame.ts +50 -0
  33. package/src/composables/options.ts +9 -1
  34. package/src/composables/tabs.ts +2 -35
  35. package/src/composables/transient.ts +27 -0
  36. package/src/content/Tabs.vue +27 -6
  37. package/src/internal.ts +1 -0
  38. package/src/layout/FfLayout.vue +3 -3
  39. package/src/styles/_base.scss +5 -9
  40. package/src/styles/_blocks.scss +4 -7
  41. package/src/styles/_blog.scss +4 -5
  42. package/src/styles/_code.scss +12 -20
  43. package/src/styles/_content.scss +153 -63
  44. package/src/styles/_doc.scss +26 -25
  45. package/src/styles/_home.scss +31 -61
  46. package/src/styles/_mixins.scss +87 -0
  47. package/src/styles/_motion.scss +12 -10
  48. package/src/styles/_nav.scss +12 -19
  49. package/src/styles/_sidebar.scss +5 -8
  50. package/src/styles/_tokens.scss +19 -4
  51. package/src/types.ts +31 -4
  52. package/types/components/FfHeroActions.vue.d.ts +19 -0
  53. package/types/composables/blog.d.ts +3 -4
  54. package/types/composables/copy.d.ts +6 -0
  55. package/types/composables/frame.d.ts +6 -0
  56. package/types/composables/tabs.d.ts +0 -5
  57. package/types/composables/transient.d.ts +6 -0
  58. package/types/internal.d.ts +1 -0
  59. package/types/types.d.ts +29 -4
@@ -3,6 +3,7 @@
3
3
  // ============================================================================================= //
4
4
 
5
5
  @use "breakpoints" as bp;
6
+ @use "mixins";
6
7
  @use "theme" as mg;
7
8
 
8
9
  .ff-theme {
@@ -183,45 +184,7 @@
183
184
  }
184
185
 
185
186
  .ff-hero-command-tab {
186
- position: relative;
187
- padding: 0 0.75rem 0.625rem;
188
- border: 0;
189
- background: transparent;
190
- font-family: #{mg.ref("font-mono")};
191
- font-size: #{mg.ref("size-label")};
192
- font-weight: 500;
193
- text-transform: uppercase;
194
- letter-spacing: #{mg.ref("tracking-label")};
195
- color: #{mg.ref("color-ink-faint")};
196
- cursor: pointer;
197
- transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
198
- }
199
-
200
- .ff-hero-command-tab:first-child {
201
- padding-left: 0;
202
- }
203
-
204
- .ff-hero-command-tab::after {
205
- position: absolute;
206
- right: 0;
207
- bottom: calc(#{mg.ref("rule-accent-width")} * -1);
208
- left: 0;
209
- height: #{mg.ref("rule-accent-width")};
210
- background: transparent;
211
- content: "";
212
- transition: background-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
213
- }
214
-
215
- .ff-hero-command-tab:hover {
216
- color: #{mg.ref("color-ink")};
217
- }
218
-
219
- .ff-hero-command-tab.active {
220
- color: #{mg.ref("color-ink")};
221
- }
222
-
223
- .ff-hero-command-tab.active::after {
224
- background: #{mg.ref("color-accent")};
187
+ @include mixins.tab;
225
188
  }
226
189
 
227
190
  // Same panel, dropped under the text instead of beside it — an image already claims the
@@ -267,7 +230,7 @@
267
230
 
268
231
  .ff-hero-command code {
269
232
  font-family: #{mg.ref("font-mono")};
270
- font-size: 0.8125rem;
233
+ font-size: #{mg.ref("size-small")};
271
234
  color: #{mg.ref("color-ink")};
272
235
  overflow-x: auto;
273
236
  }
@@ -277,10 +240,9 @@
277
240
  color: #{mg.ref("color-accent")};
278
241
  }
279
242
 
280
- // Mirrors the copy button on code blocks (see _code.scss): same icon, size and border-radius
281
- // choreography, so the two don't read as two different controls. It stays fully opaque here
282
- // rather than fading in on hover — this one isn't tucked in the corner of a block, it's the
283
- // install line's only affordance.
243
+ // The copy button shares its size and radius with the one on code blocks (see the mixins). It
244
+ // stays fully opaque here rather than fading in on hover — this one isn't tucked in the corner
245
+ // of a block, it's the install line's only affordance.
284
246
 
285
247
  .ff-hero-copy-group {
286
248
  position: relative;
@@ -300,11 +262,12 @@
300
262
  z-index: 1;
301
263
  display: flex;
302
264
  align-items: center;
303
- height: 1.75rem;
304
265
  padding: 0 0.625rem;
305
266
  border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule-strong")};
306
267
  border-right: 0;
307
- border-radius: #{mg.ref("radius-sm")} 0 0 #{mg.ref("radius-sm")};
268
+
269
+ @include mixins.copied-flag;
270
+
308
271
  background: #{mg.ref("color-surface-alt")};
309
272
  color: #{mg.ref("color-ink-muted")};
310
273
  white-space: nowrap;
@@ -312,15 +275,13 @@
312
275
 
313
276
  .ff-hero-copy {
314
277
  flex-shrink: 0;
315
- width: 1.75rem;
316
- height: 1.75rem;
317
278
  border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
318
- border-radius: #{mg.ref("radius-sm")};
319
- background-color: transparent;
279
+
280
+ @include mixins.copy-button;
281
+
320
282
  background-image: var(--vp-icon-copy);
321
283
  background-position: 50%;
322
284
  background-repeat: no-repeat;
323
- background-size: 0.875rem;
324
285
  cursor: pointer;
325
286
  }
326
287
 
@@ -330,7 +291,8 @@
330
291
  }
331
292
 
332
293
  .ff-hero-copy.copied {
333
- border-radius: 0 #{mg.ref("radius-sm")} #{mg.ref("radius-sm")} 0;
294
+ @include mixins.copy-button-copied;
295
+
334
296
  border-color: #{mg.ref("color-rule-strong")};
335
297
  background-color: #{mg.ref("color-surface-alt")};
336
298
  background-image: var(--vp-icon-copied);
@@ -373,6 +335,15 @@
373
335
  border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
374
336
  }
375
337
 
338
+ // Single column, the image or panel is the container's last cell and would end flush against
339
+ // the colophon rule: give it the same 3rem the container puts between its own cells.
340
+ @include bp.down("md") {
341
+ .ff-hero.has-image .ff-hero-meta,
342
+ .ff-hero.has-panel .ff-hero-meta {
343
+ margin-top: 3rem;
344
+ }
345
+ }
346
+
376
347
  .ff-hero-meta-item {
377
348
  padding-left: 1.5rem;
378
349
  border-left: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
@@ -390,9 +361,9 @@
390
361
  .ff-hero-meta dd {
391
362
  margin: 0;
392
363
  font-family: #{mg.ref("font-display")};
393
- font-size: 1.125rem;
364
+ font-size: #{mg.ref("size-lead")};
394
365
  font-weight: 600;
395
- letter-spacing: -0.01em;
366
+ letter-spacing: #{mg.ref("tracking-tight")};
396
367
  color: #{mg.ref("color-ink")};
397
368
  }
398
369
 
@@ -437,7 +408,7 @@
437
408
  padding: 0 1.375rem;
438
409
  border: #{mg.ref("rule-width")} solid transparent;
439
410
  border-radius: #{mg.ref("radius-sm")};
440
- font-size: 0.875rem;
411
+ font-size: #{mg.ref("size-ui")};
441
412
  font-weight: 550;
442
413
  text-decoration: none;
443
414
  white-space: nowrap;
@@ -535,9 +506,8 @@
535
506
  font-size: 2rem;
536
507
  font-weight: 500;
537
508
  line-height: 1;
538
- letter-spacing: -0.02em;
509
+ letter-spacing: #{mg.ref("tracking-heading")};
539
510
  color: #{mg.ref("color-rule-strong")};
540
- transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
541
511
  }
542
512
 
543
513
  .ff-feature-linked:hover .ff-feature-index::before {
@@ -558,9 +528,9 @@
558
528
  .ff-feature-title {
559
529
  margin: 2.25rem 0 0;
560
530
  font-family: #{mg.ref("font-display")};
561
- font-size: 1.1875rem;
531
+ font-size: #{mg.ref("size-h3")};
562
532
  font-weight: 620;
563
- letter-spacing: -0.015em;
533
+ letter-spacing: #{mg.ref("tracking-subheading")};
564
534
  color: #{mg.ref("color-ink")};
565
535
  }
566
536
 
@@ -594,7 +564,7 @@
594
564
  flex-grow: 1;
595
565
  margin: 0.75rem 0 0;
596
566
  padding: 0;
597
- font-size: 0.9375rem;
567
+ font-size: #{mg.ref("size-ui-lg")};
598
568
  line-height: 1.7;
599
569
  color: #{mg.ref("color-ink-muted")};
600
570
  }
@@ -739,7 +709,7 @@
739
709
  margin: 0 0 0.25rem;
740
710
  padding: 0 1.25rem;
741
711
  font-family: #{mg.ref("font-mono")};
742
- font-size: 0.875rem;
712
+ font-size: #{mg.ref("size-ui")};
743
713
  font-weight: 500;
744
714
  letter-spacing: #{mg.ref("tracking-label")};
745
715
  text-align: left;
@@ -0,0 +1,87 @@
1
+ // ============================================================================================= //
2
+ // MIXINS //
3
+ // ============================================================================================= //
4
+
5
+ @use "theme" as mg;
6
+
7
+ // The label voice: small uppercase mono, faint. Also the `.ff-label` class.
8
+
9
+ @mixin label {
10
+ font-family: #{mg.ref("font-mono")};
11
+ font-size: #{mg.ref("size-label")};
12
+ font-weight: 500;
13
+ text-transform: uppercase;
14
+ letter-spacing: #{mg.ref("tracking-label")};
15
+ color: #{mg.ref("color-ink-faint")};
16
+ }
17
+
18
+ // A tab in a strip under which the active one carries the accent rule. Shared by the hero panel
19
+ // tabs and the tabs block.
20
+
21
+ @mixin tab {
22
+ @include label;
23
+
24
+ position: relative;
25
+ padding: 0 0.75rem 0.625rem;
26
+ border: 0;
27
+ background: transparent;
28
+ cursor: pointer;
29
+ transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
30
+
31
+ &:first-child {
32
+ padding-left: 0;
33
+ }
34
+
35
+ &::after {
36
+ position: absolute;
37
+ right: 0;
38
+ bottom: calc(#{mg.ref("rule-accent-width")} * -1);
39
+ left: 0;
40
+ height: #{mg.ref("rule-accent-width")};
41
+ background: transparent;
42
+ content: "";
43
+ transition: background-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
44
+ }
45
+
46
+ &:hover,
47
+ &.active {
48
+ color: #{mg.ref("color-ink")};
49
+ }
50
+
51
+ &.active::after {
52
+ background: #{mg.ref("color-accent")};
53
+ }
54
+ }
55
+
56
+ // The square copy button of a code block and of the hero install line: same size, radius and icon
57
+ // size, so the two do not read as two different controls.
58
+
59
+ @mixin copy-button {
60
+ width: 1.75rem;
61
+ height: 1.75rem;
62
+ border-radius: #{mg.ref("radius-sm")};
63
+ background-color: transparent;
64
+ background-size: 0.875rem;
65
+ }
66
+
67
+ // Once copied, the button squares off its left edge to sit flush against the "Copied" flag.
68
+
69
+ @mixin copy-button-copied {
70
+ border-radius: 0 #{mg.ref("radius-sm")} #{mg.ref("radius-sm")} 0;
71
+ }
72
+
73
+ // The "Copied" flag, flush against the left of the button: same height, rounded on its far side.
74
+
75
+ @mixin copied-flag {
76
+ height: 1.75rem;
77
+ border-radius: #{mg.ref("radius-sm")} 0 0 #{mg.ref("radius-sm")};
78
+ }
79
+
80
+ // The page title: the doc h1 and the blog title read as the same voice.
81
+
82
+ @mixin page-title {
83
+ font-size: #{mg.ref("size-h1")};
84
+ font-weight: 620;
85
+ line-height: #{mg.ref("leading-tight")};
86
+ letter-spacing: #{mg.ref("tracking-title")};
87
+ }
@@ -60,29 +60,29 @@
60
60
  }
61
61
 
62
62
  .ff-hero-title {
63
- animation-delay: 0.06s;
63
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 3);
64
64
  }
65
65
 
66
66
  .ff-hero-tagline {
67
- animation-delay: 0.12s;
67
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 6);
68
68
  }
69
69
 
70
70
  .ff-hero-main .ff-hero-actions {
71
- animation-delay: 0.18s;
71
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 9);
72
72
  }
73
73
 
74
74
  .ff-hero-panel {
75
- animation-delay: 0.2s;
76
- animation-duration: 0.8s;
75
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 10);
76
+ animation-duration: #{mg.ref("motion-duration-enter-panel")};
77
77
  }
78
78
 
79
79
  .ff-hero-meta {
80
- animation-delay: 0.3s;
80
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 15);
81
81
  }
82
82
 
83
83
  .ff-hero-image {
84
- animation-delay: 0.14s;
85
- animation-duration: 0.9s;
84
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 7);
85
+ animation-duration: #{mg.ref("motion-duration-enter-image")};
86
86
  }
87
87
 
88
88
  // Nothing else animates on arrival. Revealing cells and cards on scroll was tried and
@@ -125,7 +125,7 @@
125
125
  right: 0.75rem;
126
126
  bottom: 1rem;
127
127
  left: 0.75rem;
128
- height: 2px;
128
+ height: #{mg.ref("rule-accent-width")};
129
129
  background: #{mg.ref("color-accent")};
130
130
  transform: scaleX(0);
131
131
  transform-origin: left;
@@ -200,7 +200,7 @@
200
200
  .ff-to-top,
201
201
  .VPNavBarSearchButton,
202
202
  .vp-doc [class*="language-"] > button.copy,
203
- .VPDocFooter .pager-link .title,
203
+ .ff-feedback-button,
204
204
  .ff-footer-column a,
205
205
  .VPDocAsideOutline .outline-link,
206
206
  .VPSidebarItem .link .text {
@@ -227,6 +227,8 @@
227
227
  .ff-to-top,
228
228
  .ff-hero-command-tab,
229
229
  .ff-hero-command-tab::after,
230
+ .vp-doc .ff-tabs-tab,
231
+ .vp-doc .ff-tabs-tab::after,
230
232
  .ff-hero-copy,
231
233
  .VPNavBarMenuLink::after {
232
234
  transition: none;
@@ -91,7 +91,6 @@
91
91
  }
92
92
  }
93
93
 
94
- .VPNavBar.has-sidebar .curtain,
95
94
  .VPNavBar .divider {
96
95
  display: none;
97
96
  }
@@ -152,15 +151,6 @@
152
151
 
153
152
  // Site name: display face, and a small accent square standing in for a logo when there is none.
154
153
 
155
- .VPNavBarTitle .title {
156
- border-bottom: 0;
157
- gap: 0.625rem;
158
- font-family: #{mg.ref("font-display")};
159
- font-size: 0.9375rem;
160
- font-weight: 620;
161
- letter-spacing: -0.01em;
162
- }
163
-
164
154
  .VPNavBarTitle .title:not(:has(.logo))::before {
165
155
  content: "";
166
156
  width: 0.5rem;
@@ -183,8 +173,14 @@
183
173
  align-items: center;
184
174
  min-width: 0;
185
175
  height: 100%;
176
+ border-bottom: 0;
177
+ gap: 0.625rem;
178
+ font-family: #{mg.ref("font-display")};
179
+ font-size: #{mg.ref("size-ui-lg")};
180
+ font-weight: 620;
181
+ letter-spacing: #{mg.ref("tracking-tight")};
186
182
  color: var(--vp-c-text-1);
187
- transition: opacity 0.25s;
183
+ transition: opacity #{mg.ref("motion-duration-fade")} #{mg.ref("motion-ease")};
188
184
  }
189
185
 
190
186
  // Wherever the bar runs out of room, the title text gives way first.
@@ -248,7 +244,7 @@
248
244
 
249
245
  .VPNavBarMenuLink,
250
246
  .VPNavBarMenuGroup .button {
251
- font-size: 0.875rem;
247
+ font-size: #{mg.ref("size-ui")};
252
248
  font-weight: 500;
253
249
  color: #{mg.ref("color-ink-muted")};
254
250
  transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
@@ -265,7 +261,6 @@
265
261
 
266
262
  // Search trigger
267
263
 
268
- .VPNavBarSearch .DocSearch-Button,
269
264
  .VPNavBarSearchButton {
270
265
  display: flex;
271
266
  align-items: center;
@@ -275,9 +270,8 @@
275
270
  border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
276
271
  border-radius: #{mg.ref("radius-sm")};
277
272
  background: transparent;
278
- font-size: 0.8125rem;
273
+ font-size: #{mg.ref("size-small")};
279
274
  color: #{mg.ref("color-ink-faint")};
280
- transition: border-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
281
275
  }
282
276
 
283
277
  .VPNavBarSearchButton:hover {
@@ -285,8 +279,7 @@
285
279
  color: #{mg.ref("color-ink-muted")};
286
280
  }
287
281
 
288
- .VPNavBarSearchButton .keys kbd,
289
- .VPNavBarSearchButton .keys .key-cmd {
282
+ .VPNavBarSearchButton .keys kbd {
290
283
  border: 0;
291
284
  border-radius: 0;
292
285
  background: transparent;
@@ -305,13 +298,13 @@
305
298
  }
306
299
 
307
300
  .VPSwitch .check {
308
- border-radius: 2px;
301
+ border-radius: #{mg.ref("radius-xs")};
309
302
  background: #{mg.ref("color-surface-alt")};
310
303
  box-shadow: none;
311
304
  }
312
305
 
313
306
  .VPSwitch .icon {
314
- border-radius: 2px;
307
+ border-radius: #{mg.ref("radius-xs")};
315
308
  }
316
309
 
317
310
  // ----------------------------------------------------------------------------------------- //
@@ -23,11 +23,8 @@
23
23
 
24
24
  .VPSidebar .nav {
25
25
  padding-top: 1.5rem;
26
- }
27
-
28
- // Sections are numbered from the stylesheet: 01, 02, 03 — no config, no markup.
29
26
 
30
- .VPSidebar .nav {
27
+ // Sections are numbered from the stylesheet: 01, 02, 03 — no config, no markup.
31
28
  counter-reset: ff-section;
32
29
  }
33
30
 
@@ -62,7 +59,7 @@
62
59
  .VPSidebar .group > .VPSidebarItem.level-0 > .item::before {
63
60
  content: counter(ff-section, decimal-leading-zero);
64
61
  font-family: #{mg.ref("font-mono")};
65
- font-size: 0.8125rem;
62
+ font-size: #{mg.ref("size-small")};
66
63
  font-weight: 600;
67
64
  line-height: 1.4;
68
65
  letter-spacing: 0.02em;
@@ -72,7 +69,7 @@
72
69
  .VPSidebarItem.level-0 > .item > .text {
73
70
  padding: 0;
74
71
  font-family: #{mg.ref("font-mono")};
75
- font-size: 0.8125rem;
72
+ font-size: #{mg.ref("size-small")};
76
73
  font-weight: 600;
77
74
  line-height: 1.4;
78
75
  text-transform: uppercase;
@@ -88,7 +85,7 @@
88
85
  .VPSidebarItem.level-2 .text,
89
86
  .VPSidebarItem.level-3 .text {
90
87
  padding: 0.25rem 0;
91
- font-size: 0.875rem;
88
+ font-size: #{mg.ref("size-ui")};
92
89
  font-weight: 450;
93
90
  line-height: 1.6;
94
91
  color: #{mg.ref("color-ink-muted")};
@@ -125,7 +122,7 @@
125
122
  .VPSidebarItem.level-2 .text,
126
123
  .VPSidebarItem.level-3 .text {
127
124
  padding: 0.375rem 0;
128
- font-size: 0.8125rem;
125
+ font-size: #{mg.ref("size-small")};
129
126
  }
130
127
 
131
128
  .VPSidebarItem.is-active > .item > .indicator {
@@ -27,6 +27,10 @@ $scales: (
27
27
  ),
28
28
  "tracking": (
29
29
  "display": -0.025em,
30
+ "title": -0.03em,
31
+ "heading": -0.02em,
32
+ "subheading": -0.015em,
33
+ "tight": -0.01em,
30
34
  "label": 0.1em,
31
35
  "label-tight": 0.06em,
32
36
  "label-wide": 0.08em
@@ -34,6 +38,9 @@ $scales: (
34
38
  "size": (
35
39
  "label": 0.6875rem,
36
40
  "meta": 0.75rem,
41
+ "small": 0.8125rem,
42
+ "ui": 0.875rem,
43
+ "ui-lg": 0.9375rem,
37
44
  "body": 1rem,
38
45
  "lead": 1.125rem,
39
46
  "h1": clamp(1.625rem, 1.3rem + 1.3vw, 2rem),
@@ -46,8 +53,9 @@ $scales: (
46
53
  "tight": 1.15
47
54
  ),
48
55
  "radius": (
49
- "sm": 5px,
50
- "md": 10px
56
+ "xs": 0.125rem,
57
+ "sm": 0.3125rem,
58
+ "md": 0.625rem
51
59
  ),
52
60
  "rule": (
53
61
  "width": 1px,
@@ -56,12 +64,19 @@ $scales: (
56
64
  "motion": (
57
65
  "duration": 200ms,
58
66
  "duration-slow": 420ms,
67
+ "duration-fade": 250ms,
59
68
  "duration-enter": 650ms,
69
+ "duration-enter-panel": 800ms,
70
+ "duration-enter-image": 900ms,
71
+ "stagger": 20ms,
60
72
  "ease": cubic-bezier(0.2, 0.6, 0.2, 1)
61
73
  ),
62
74
  "banner": (
63
75
  "height": 2.6875rem
64
76
  ),
77
+ "z": (
78
+ "float": 20
79
+ ),
65
80
 
66
81
  /* The two washes of light behind the hero. Off by default: they are a house style, not a*/
67
82
  /* structural part of the layout, and they read as noise under a headline that is already*/
@@ -291,7 +306,7 @@ $presets: (
291
306
  --vp-button-alt-hover-text: #{mg.ref("color-ink")};
292
307
  --vp-button-alt-hover-bg: transparent;
293
308
  --vp-button-alt-active-bg: #{mg.ref("color-surface-alt")};
294
- --vp-custom-block-font-size: 0.9375rem;
295
- --vp-custom-block-code-font-size: 0.8125rem;
309
+ --vp-custom-block-font-size: #{mg.ref("size-ui-lg")};
310
+ --vp-custom-block-code-font-size: #{mg.ref("size-small")};
296
311
  --vp-home-hero-name-color: #{mg.ref("color-ink")};
297
312
  }
package/src/types.ts CHANGED
@@ -88,12 +88,28 @@ export interface ThemeLabels {
88
88
  feedbackThanks?: string
89
89
  /** Button copying the page as Markdown. Defaults to `Copy as Markdown`. */
90
90
  copyMarkdown?: string
91
+ /** Second line of the Markdown menu item. Defaults to `Page source`. */
92
+ copyMarkdownHint?: string
93
+ /** Accessible name of the chevron opening the page actions menu. Defaults to `More page actions`. */
94
+ pageActions?: string
95
+ /** Main button copying the page URL. Defaults to `Copy link`. */
96
+ copyLink?: string
97
+ /** Trigger of the menu when there is nothing to copy. Defaults to `Share`. */
98
+ share?: string
99
+ /** Confirmation shown once the page URL is copied. Defaults to `Link copied`. */
100
+ linkCopied?: string
101
+ /** Share menu item; `{0}` is the network name. Defaults to `Share on {0}`. */
102
+ shareOn?: string
91
103
  /** Accessible name of the version menu, followed by the current version. Defaults to `Version`. */
92
104
  versionSwitcher?: string
93
105
  /** Author line of a post; `{0}` is the name. Defaults to `By {0}`. */
94
106
  blogBy?: string
95
107
  /** Message of a blog index without any post. Defaults to `No posts yet`. */
96
108
  blogEmpty?: string
109
+ /** Tooltip of the back-to-top control, unless the default theme's `returnToTopLabel` is set. Defaults to `Return to top`. */
110
+ returnToTop?: string
111
+ /** Screen-reader announcement once a code block is copied. Defaults to `Copied`. */
112
+ codeCopied?: string
97
113
  }
98
114
 
99
115
  /** One author of the blog, declared in `ff.blog.authors` and referred to by key from a post. */
@@ -126,7 +142,7 @@ export interface BlogConfig {
126
142
  export interface OgFont {
127
143
  /** Family name, also used to draw the text. The first font of the list is the one used. */
128
144
  name: string
129
- /** TTF, OTF or WOFF file (not WOFF2), relative to the site's source directory. */
145
+ /** TTF, OTF or WOFF file (not WOFF2), relative to the VitePress root (the folder holding `.vitepress`). */
130
146
  path: string
131
147
  weight?: number
132
148
  style?: 'normal' | 'italic'
@@ -221,10 +237,21 @@ export interface ThemeOptions {
221
237
  */
222
238
  feedback?: boolean | FeedbackConfig
223
239
  /**
224
- * Button in the page kicker that copies the page's Markdown source. Off by default. The source
225
- * is injected by `ffTransformPageData`, which a site defining its own `transformPageData` must
226
- * call from it.
240
+ * Menu in the page kicker with page actions. By default only "Copy link" is on; `true` turns on
241
+ * every action and `false` turns the menu off.
242
+ * The Markdown source is injected by `ffTransformPageData`, which a site defining its own
243
+ * `transformPageData` must call from it. Mastodon has no universal share intent, so its link
244
+ * targets `mastodonInstance` (defaults to `mastodon.social`).
227
245
  */
246
+ pageActions?:
247
+ | boolean
248
+ | {
249
+ copyMarkdown?: boolean
250
+ copyLink?: boolean
251
+ share?: Array<'x' | 'linkedin' | 'bluesky' | 'mastodon'>
252
+ mastodonInstance?: string
253
+ }
254
+ /** @deprecated Use `pageActions: { copyMarkdown: true }`. */
228
255
  copyMarkdown?: boolean
229
256
  /**
230
257
  * Writes `llms.txt` and `llms-full.txt` to the output directory at the end of the build. Off by
@@ -0,0 +1,19 @@
1
+ import type { HeroAction } from './FfHero.vue';
2
+ type __VLS_Props = {
3
+ actions: HeroAction[];
4
+ };
5
+ declare const __VLS_template: () => {
6
+ __VLS_Slots: {
7
+ before?: (props: {}) => any;
8
+ };
9
+ };
10
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -1,10 +1,9 @@
1
- import type { BlogAuthor } from '../types';
1
+ import { resolveAuthor } from '../../node/blog.js';
2
+ export { resolveAuthor };
2
3
  /** Blog options, with the directory normalised (no slash at either end). */
3
4
  export declare function useBlog(): {
4
5
  dir: import("vue").ComputedRef<string>;
5
6
  isPost: import("vue").ComputedRef<boolean>;
6
- authors: import("vue").ComputedRef<Record<string, BlogAuthor>>;
7
+ authors: import("vue").ComputedRef<Record<string, import("../types.js").BlogAuthor>>;
7
8
  };
8
- /** `author` is a key of `ff.blog.authors`, or a plain name used as is. */
9
- export declare function resolveAuthor(authors: Record<string, BlogAuthor>, value?: string): BlogAuthor | null;
10
9
  export declare function formatDate(date: string, lang: string): string;
@@ -0,0 +1,6 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ /** Copies a string to the clipboard and flags it as copied for two seconds. */
3
+ export declare function useCopy(text: MaybeRefOrGetter<string>): {
4
+ copied: import("vue").Ref<boolean, boolean>;
5
+ copy: () => Promise<void>;
6
+ };
@@ -0,0 +1,6 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * Runs `update` once, then at most once per frame however many of the window `events` fire. Listens
4
+ * only while `enabled` is true and follows it if it changes; everything is undone on unmount.
5
+ */
6
+ export declare function useFrameListener(enabled: MaybeRefOrGetter<boolean>, update: () => void, events: string[]): void;
@@ -8,8 +8,3 @@ export declare function useTabs(labels: MaybeRefOrGetter<string[]>, syncKey?: Ma
8
8
  select: (index: number) => void;
9
9
  onKeydown: (event: KeyboardEvent) => void;
10
10
  };
11
- /** Copies a string to the clipboard and flags it as copied for two seconds. */
12
- export declare function useCopy(text: MaybeRefOrGetter<string>): {
13
- copied: import("vue").Ref<boolean, boolean>;
14
- copy: () => Promise<void>;
15
- };
@@ -0,0 +1,6 @@
1
+ /** A flag that turns itself off `ms` milliseconds after `start()`; the timer dies with the component. */
2
+ export declare function useTransientFlag(ms?: number): {
3
+ active: import("vue").Ref<boolean, boolean>;
4
+ start: () => void;
5
+ stop: () => void;
6
+ };