@frontfactory/vitepress-theme 1.7.0 → 1.9.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 (100) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +163 -7
  3. package/config.d.ts +27 -1
  4. package/config.js +186 -21
  5. package/dist/style.css +1 -1
  6. package/node/blog.d.ts +3 -0
  7. package/node/blog.js +19 -0
  8. package/node/llms.js +32 -0
  9. package/node/og.js +158 -0
  10. package/node/pages.js +162 -0
  11. package/node/rss.js +78 -0
  12. package/package.json +42 -28
  13. package/src/blog/posts.data.ts +47 -0
  14. package/src/components/FfBackToTop.vue +19 -10
  15. package/src/components/FfBanner.vue +24 -6
  16. package/src/components/FfCopyStatus.vue +64 -0
  17. package/src/components/FfDocMeta.vue +325 -3
  18. package/src/components/FfFeature.vue +18 -7
  19. package/src/components/FfFeedback.vue +96 -0
  20. package/src/components/FfHero.vue +26 -35
  21. package/src/components/FfHeroActions.vue +44 -0
  22. package/src/components/FfHeroCommand.vue +22 -35
  23. package/src/components/FfHomeSponsors.vue +2 -2
  24. package/src/components/FfNavBarTitle.vue +63 -0
  25. package/src/components/FfPost.vue +50 -0
  26. package/src/components/FfProgress.vue +69 -0
  27. package/src/components/FfVersionSwitcher.vue +20 -0
  28. package/src/composables/blog.ts +41 -0
  29. package/src/composables/copy.ts +36 -0
  30. package/src/composables/options.ts +20 -1
  31. package/src/composables/tabs.ts +122 -0
  32. package/src/content/Api.vue +6 -2
  33. package/src/content/Badge.vue +26 -0
  34. package/src/content/Callout.vue +27 -0
  35. package/src/content/FileTree.vue +118 -0
  36. package/src/content/Tab.vue +11 -0
  37. package/src/content/Tabs.vue +95 -0
  38. package/src/content/Timeline.vue +19 -0
  39. package/src/content/TimelineItem.vue +37 -0
  40. package/src/content/timeline.ts +4 -0
  41. package/src/index.ts +37 -1
  42. package/src/internal.ts +8 -2
  43. package/src/layout/FfBlog.vue +62 -0
  44. package/src/layout/FfLayout.vue +20 -4
  45. package/src/styles/_base.scss +6 -14
  46. package/src/styles/_blocks.scss +29 -8
  47. package/src/styles/_blog.scss +130 -0
  48. package/src/styles/_breakpoints.scss +26 -0
  49. package/src/styles/_code.scss +11 -17
  50. package/src/styles/_content.scss +377 -18
  51. package/src/styles/_doc.scss +32 -29
  52. package/src/styles/_home.scss +47 -65
  53. package/src/styles/_mixins.scss +63 -0
  54. package/src/styles/_motion.scss +24 -13
  55. package/src/styles/_nav.scss +90 -24
  56. package/src/styles/_print.scss +77 -0
  57. package/src/styles/_sidebar.scss +7 -10
  58. package/src/styles/_tokens.scss +92 -11
  59. package/src/styles/index.scss +2 -0
  60. package/src/types.ts +148 -0
  61. package/types/blog/posts.data.d.ts +14 -0
  62. package/types/components/FfBackToTop.vue.d.ts +3 -0
  63. package/types/components/FfBanner.vue.d.ts +3 -0
  64. package/types/components/FfCopyStatus.vue.d.ts +3 -0
  65. package/types/components/FfDocMeta.vue.d.ts +3 -0
  66. package/types/components/FfFeature.vue.d.ts +13 -0
  67. package/types/components/FfFeedback.vue.d.ts +3 -0
  68. package/types/components/FfFooter.vue.d.ts +3 -0
  69. package/types/components/FfHero.vue.d.ts +42 -0
  70. package/types/components/FfHeroActions.vue.d.ts +19 -0
  71. package/types/components/FfHeroCommand.vue.d.ts +9 -0
  72. package/types/components/FfHomeSponsors.vue.d.ts +19 -0
  73. package/types/components/FfNavBarTitle.vue.d.ts +17 -0
  74. package/types/components/FfPost.vue.d.ts +3 -0
  75. package/types/components/FfProgress.vue.d.ts +3 -0
  76. package/types/components/FfVersionSwitcher.vue.d.ts +3 -0
  77. package/types/composables/blog.d.ts +10 -0
  78. package/types/composables/copy.d.ts +6 -0
  79. package/types/composables/link.d.ts +12 -0
  80. package/types/composables/options.d.ts +15 -0
  81. package/types/composables/relativeTime.d.ts +2 -0
  82. package/types/composables/tabs.d.ts +10 -0
  83. package/types/content/Api.vue.d.ts +27 -0
  84. package/types/content/Badge.vue.d.ts +21 -0
  85. package/types/content/Callout.vue.d.ts +24 -0
  86. package/types/content/Card.vue.d.ts +23 -0
  87. package/types/content/CardGrid.vue.d.ts +20 -0
  88. package/types/content/FileTree.vue.d.ts +6 -0
  89. package/types/content/Kbd.vue.d.ts +15 -0
  90. package/types/content/Steps.vue.d.ts +15 -0
  91. package/types/content/Tab.vue.d.ts +19 -0
  92. package/types/content/Tabs.vue.d.ts +7 -0
  93. package/types/content/Timeline.vue.d.ts +21 -0
  94. package/types/content/TimelineItem.vue.d.ts +21 -0
  95. package/types/content/timeline.d.ts +3 -0
  96. package/types/index.d.ts +25 -0
  97. package/types/internal.d.ts +10 -0
  98. package/types/layout/FfBlog.vue.d.ts +3 -0
  99. package/types/layout/FfLayout.vue.d.ts +23 -0
  100. package/types/types.d.ts +280 -0
@@ -2,6 +2,8 @@
2
2
  // HOME //
3
3
  // ============================================================================================= //
4
4
 
5
+ @use "breakpoints" as bp;
6
+ @use "mixins";
5
7
  @use "theme" as mg;
6
8
 
7
9
  .ff-theme {
@@ -163,7 +165,7 @@
163
165
  border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
164
166
  border-radius: #{mg.ref("radius-md")};
165
167
  background: #{mg.ref("color-surface")};
166
- box-shadow: 0 1.5rem 3rem rgb(0 0 0 / 0.05);
168
+ box-shadow: 0 1.5rem 3rem #{mg.ref("color-shadow-sm")};
167
169
  }
168
170
 
169
171
  .ff-hero-panel-label {
@@ -182,45 +184,7 @@
182
184
  }
183
185
 
184
186
  .ff-hero-command-tab {
185
- position: relative;
186
- padding: 0 0.75rem 0.625rem;
187
- border: 0;
188
- background: transparent;
189
- font-family: #{mg.ref("font-mono")};
190
- font-size: #{mg.ref("size-label")};
191
- font-weight: 500;
192
- text-transform: uppercase;
193
- letter-spacing: #{mg.ref("tracking-label")};
194
- color: #{mg.ref("color-ink-faint")};
195
- cursor: pointer;
196
- transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
197
- }
198
-
199
- .ff-hero-command-tab:first-child {
200
- padding-left: 0;
201
- }
202
-
203
- .ff-hero-command-tab::after {
204
- position: absolute;
205
- right: 0;
206
- bottom: calc(#{mg.ref("rule-accent-width")} * -1);
207
- left: 0;
208
- height: #{mg.ref("rule-accent-width")};
209
- background: transparent;
210
- content: "";
211
- transition: background-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
212
- }
213
-
214
- .ff-hero-command-tab:hover {
215
- color: #{mg.ref("color-ink")};
216
- }
217
-
218
- .ff-hero-command-tab.active {
219
- color: #{mg.ref("color-ink")};
220
- }
221
-
222
- .ff-hero-command-tab.active::after {
223
- background: #{mg.ref("color-accent")};
187
+ @include mixins.tab;
224
188
  }
225
189
 
226
190
  // Same panel, dropped under the text instead of beside it — an image already claims the
@@ -266,7 +230,7 @@
266
230
 
267
231
  .ff-hero-command code {
268
232
  font-family: #{mg.ref("font-mono")};
269
- font-size: 0.8125rem;
233
+ font-size: #{mg.ref("size-small")};
270
234
  color: #{mg.ref("color-ink")};
271
235
  overflow-x: auto;
272
236
  }
@@ -321,9 +285,6 @@
321
285
  background-repeat: no-repeat;
322
286
  background-size: 0.875rem;
323
287
  cursor: pointer;
324
- transition:
325
- border-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")},
326
- background-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
327
288
  }
328
289
 
329
290
  .ff-hero-copy:hover {
@@ -354,7 +315,7 @@
354
315
  height: auto;
355
316
  }
356
317
 
357
- @media (width >= 960px) {
318
+ @include bp.up("md") {
358
319
  .ff-hero-image {
359
320
  max-width: none;
360
321
  }
@@ -392,19 +353,19 @@
392
353
  .ff-hero-meta dd {
393
354
  margin: 0;
394
355
  font-family: #{mg.ref("font-display")};
395
- font-size: 1.125rem;
356
+ font-size: #{mg.ref("size-lead")};
396
357
  font-weight: 600;
397
- letter-spacing: -0.01em;
358
+ letter-spacing: #{mg.ref("tracking-tight")};
398
359
  color: #{mg.ref("color-ink")};
399
360
  }
400
361
 
401
- @media (width >= 640px) {
362
+ @include bp.up("sm") {
402
363
  .ff-hero {
403
364
  padding: calc(var(--ff-hero-offset) + 2rem) 3rem 4rem;
404
365
  }
405
366
  }
406
367
 
407
- @media (width >= 960px) {
368
+ @include bp.up("md") {
408
369
  .ff-hero {
409
370
  padding: calc(var(--ff-hero-offset) + 2.25rem) 4rem 4.5rem;
410
371
  }
@@ -439,7 +400,7 @@
439
400
  padding: 0 1.375rem;
440
401
  border: #{mg.ref("rule-width")} solid transparent;
441
402
  border-radius: #{mg.ref("radius-sm")};
442
- font-size: 0.875rem;
403
+ font-size: #{mg.ref("size-ui")};
443
404
  font-weight: 550;
444
405
  text-decoration: none;
445
406
  white-space: nowrap;
@@ -537,12 +498,11 @@
537
498
  font-size: 2rem;
538
499
  font-weight: 500;
539
500
  line-height: 1;
540
- letter-spacing: -0.02em;
501
+ letter-spacing: #{mg.ref("tracking-heading")};
541
502
  color: #{mg.ref("color-rule-strong")};
542
- transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
543
503
  }
544
504
 
545
- a.ff-feature:hover .ff-feature-index::before {
505
+ .ff-feature-linked:hover .ff-feature-index::before {
546
506
  color: #{mg.ref("color-accent")};
547
507
  }
548
508
 
@@ -560,12 +520,34 @@
560
520
  .ff-feature-title {
561
521
  margin: 2.25rem 0 0;
562
522
  font-family: #{mg.ref("font-display")};
563
- font-size: 1.1875rem;
523
+ font-size: #{mg.ref("size-h3")};
564
524
  font-weight: 620;
565
- letter-spacing: -0.015em;
525
+ letter-spacing: #{mg.ref("tracking-subheading")};
566
526
  color: #{mg.ref("color-ink")};
567
527
  }
568
528
 
529
+ .ff-feature-anchor {
530
+ color: inherit;
531
+ text-decoration: none;
532
+ }
533
+
534
+ // Stretched over the whole card, so it stays clickable everywhere.
535
+ .ff-feature-anchor::before {
536
+ content: "";
537
+ position: absolute;
538
+ inset: 0;
539
+ }
540
+
541
+ // The focus ring goes around the card the link covers, not around the title alone.
542
+ .ff-feature-anchor:focus-visible {
543
+ outline: none;
544
+ }
545
+
546
+ .ff-feature:has(.ff-feature-anchor:focus-visible) {
547
+ outline: 2px solid #{mg.ref("color-accent")};
548
+ outline-offset: -2px;
549
+ }
550
+
569
551
  .ff-feature-icon + .ff-feature-title {
570
552
  margin-top: 1.5rem;
571
553
  }
@@ -574,7 +556,7 @@
574
556
  flex-grow: 1;
575
557
  margin: 0.75rem 0 0;
576
558
  padding: 0;
577
- font-size: 0.9375rem;
559
+ font-size: #{mg.ref("size-ui-lg")};
578
560
  line-height: 1.7;
579
561
  color: #{mg.ref("color-ink-muted")};
580
562
  }
@@ -589,7 +571,7 @@
589
571
  color: #{mg.ref("color-accent")};
590
572
  }
591
573
 
592
- @media (width >= 640px) {
574
+ @include bp.up("sm") {
593
575
  .VPFeatures {
594
576
  padding: 3rem 3rem 3.5rem;
595
577
  }
@@ -599,7 +581,7 @@
599
581
  }
600
582
  }
601
583
 
602
- @media (width >= 960px) {
584
+ @include bp.up("md") {
603
585
  .VPFeatures {
604
586
  padding: 3.5rem 4rem 4rem;
605
587
  }
@@ -699,12 +681,12 @@
699
681
  // dead padding. Fixed values here instead, sized so the mark actually fills its tile.
700
682
 
701
683
  .ff-sponsors-grid .vp-sponsor-grid-link {
702
- min-height: 90px;
684
+ min-height: 5.625rem;
703
685
  }
704
686
 
705
687
  .ff-sponsors-grid .vp-sponsor-grid-image {
706
- max-width: 120px;
707
- max-height: 32px;
688
+ max-width: 7.5rem;
689
+ max-height: 2rem;
708
690
  }
709
691
 
710
692
  // Same background band as the default (`--vp-c-bg-soft`, already remapped to the theme's own
@@ -715,11 +697,11 @@
715
697
  display: flex;
716
698
  align-items: center;
717
699
  justify-content: flex-start;
718
- height: 60px;
700
+ height: 3.75rem;
719
701
  margin: 0 0 0.25rem;
720
702
  padding: 0 1.25rem;
721
703
  font-family: #{mg.ref("font-mono")};
722
- font-size: 14px;
704
+ font-size: #{mg.ref("size-ui")};
723
705
  font-weight: 500;
724
706
  letter-spacing: #{mg.ref("tracking-label")};
725
707
  text-align: left;
@@ -731,7 +713,7 @@
731
713
  margin-top: 2rem;
732
714
  }
733
715
 
734
- @media (width >= 640px) {
716
+ @include bp.up("sm") {
735
717
  .ff-sponsors {
736
718
  padding: 3rem 3rem 3.5rem;
737
719
  }
@@ -742,7 +724,7 @@
742
724
  }
743
725
  }
744
726
 
745
- @media (width >= 960px) {
727
+ @include bp.up("md") {
746
728
  .ff-sponsors {
747
729
  padding: 3.5rem 4rem 4rem;
748
730
  }
@@ -0,0 +1,63 @@
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 page title: the doc h1 and the blog title read as the same voice.
57
+
58
+ @mixin page-title {
59
+ font-size: #{mg.ref("size-h1")};
60
+ font-weight: 620;
61
+ line-height: #{mg.ref("leading-tight")};
62
+ letter-spacing: #{mg.ref("tracking-title")};
63
+ }
@@ -41,6 +41,14 @@
41
41
  animation: ff-drift 26s #{mg.ref("motion-ease")} infinite alternate;
42
42
  }
43
43
 
44
+ // The washes are off by default (--ff-hero-glow-opacity: 0). Where style queries exist,
45
+ // do not run a 26s loop on two large layers nobody can see.
46
+ @container style(--ff-hero-glow-opacity: 0) {
47
+ .ff-hero-glow {
48
+ animation: none;
49
+ }
50
+ }
51
+
44
52
  .ff-hero-kicker,
45
53
  .ff-hero-title,
46
54
  .ff-hero-tagline,
@@ -48,33 +56,33 @@
48
56
  .ff-hero-panel,
49
57
  .ff-hero-meta,
50
58
  .ff-hero-image {
51
- animation: ff-rise 0.65s #{mg.ref("motion-ease")} both;
59
+ animation: ff-rise #{mg.ref("motion-duration-enter")} #{mg.ref("motion-ease")} both;
52
60
  }
53
61
 
54
62
  .ff-hero-title {
55
- animation-delay: 0.06s;
63
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 3);
56
64
  }
57
65
 
58
66
  .ff-hero-tagline {
59
- animation-delay: 0.12s;
67
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 6);
60
68
  }
61
69
 
62
70
  .ff-hero-main .ff-hero-actions {
63
- animation-delay: 0.18s;
71
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 9);
64
72
  }
65
73
 
66
74
  .ff-hero-panel {
67
- animation-delay: 0.2s;
68
- animation-duration: 0.8s;
75
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 10);
76
+ animation-duration: #{mg.ref("motion-duration-enter-panel")};
69
77
  }
70
78
 
71
79
  .ff-hero-meta {
72
- animation-delay: 0.3s;
80
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 15);
73
81
  }
74
82
 
75
83
  .ff-hero-image {
76
- animation-delay: 0.14s;
77
- animation-duration: 0.9s;
84
+ animation-delay: calc(#{mg.ref("motion-stagger")} * 7);
85
+ animation-duration: #{mg.ref("motion-duration-enter-image")};
78
86
  }
79
87
 
80
88
  // Nothing else animates on arrival. Revealing cells and cards on scroll was tried and
@@ -117,7 +125,7 @@
117
125
  right: 0.75rem;
118
126
  bottom: 1rem;
119
127
  left: 0.75rem;
120
- height: 2px;
128
+ height: #{mg.ref("rule-accent-width")};
121
129
  background: #{mg.ref("color-accent")};
122
130
  transform: scaleX(0);
123
131
  transform-origin: left;
@@ -152,7 +160,7 @@
152
160
  transition: opacity #{mg.ref("motion-duration-slow")} #{mg.ref("motion-ease")};
153
161
  }
154
162
 
155
- a.ff-feature:hover::after {
163
+ .ff-feature-linked:hover::after {
156
164
  opacity: 1;
157
165
  }
158
166
 
@@ -192,7 +200,7 @@
192
200
  .ff-to-top,
193
201
  .VPNavBarSearchButton,
194
202
  .vp-doc [class*="language-"] > button.copy,
195
- .VPDocFooter .pager-link .title,
203
+ .ff-feedback-button,
196
204
  .ff-footer-column a,
197
205
  .VPDocAsideOutline .outline-link,
198
206
  .VPSidebarItem .link .text {
@@ -219,7 +227,10 @@
219
227
  .ff-to-top,
220
228
  .ff-hero-command-tab,
221
229
  .ff-hero-command-tab::after,
222
- .ff-hero-copy {
230
+ .vp-doc .ff-tabs-tab,
231
+ .vp-doc .ff-tabs-tab::after,
232
+ .ff-hero-copy,
233
+ .VPNavBarMenuLink::after {
223
234
  transition: none;
224
235
  }
225
236
  }
@@ -2,6 +2,7 @@
2
2
  // NAVIGATION //
3
3
  // ============================================================================================= //
4
4
 
5
+ @use "breakpoints" as bp;
5
6
  @use "theme" as mg;
6
7
 
7
8
  .ff-theme {
@@ -37,7 +38,7 @@
37
38
  margin-top: 0;
38
39
  }
39
40
 
40
- @media (width >= 960px) {
41
+ @include bp.up("md") {
41
42
  &[data-nav-sticky="false"] .VPContent {
42
43
  padding-top: 0;
43
44
  }
@@ -90,7 +91,6 @@
90
91
  }
91
92
  }
92
93
 
93
- .VPNavBar.has-sidebar .curtain,
94
94
  .VPNavBar .divider {
95
95
  display: none;
96
96
  }
@@ -107,13 +107,13 @@
107
107
  // The gutters have to match the ones the hero uses, or the bar lands a few pixels off the
108
108
  // content it sits above.
109
109
 
110
- @media (width >= 640px) {
110
+ @include bp.up("sm") {
111
111
  .VPNavBar:not(.has-sidebar) .wrapper {
112
112
  padding: 0 3rem;
113
113
  }
114
114
  }
115
115
 
116
- @media (width >= 960px) {
116
+ @include bp.up("md") {
117
117
  .VPNavBar:not(.has-sidebar) .wrapper {
118
118
  padding: 0 4rem;
119
119
  }
@@ -151,27 +151,100 @@
151
151
 
152
152
  // Site name: display face, and a small accent square standing in for a logo when there is none.
153
153
 
154
+ .VPNavBarTitle .title:not(:has(.logo))::before {
155
+ content: "";
156
+ width: 0.5rem;
157
+ height: 0.5rem;
158
+ background: #{mg.ref("color-accent")};
159
+ }
160
+
161
+ // FfNavBarTitle replaces the default title, whose scoped layout rules go with it: they are
162
+ // restated here, with the row now holding the title link and the version switcher.
163
+
164
+ .VPNavBarTitle {
165
+ display: flex;
166
+ align-items: center;
167
+ gap: 0.75rem;
168
+ height: var(--vp-nav-height);
169
+ }
170
+
154
171
  .VPNavBarTitle .title {
172
+ display: flex;
173
+ align-items: center;
174
+ min-width: 0;
175
+ height: 100%;
155
176
  border-bottom: 0;
156
177
  gap: 0.625rem;
157
178
  font-family: #{mg.ref("font-display")};
158
- font-size: 0.9375rem;
179
+ font-size: #{mg.ref("size-ui-lg")};
159
180
  font-weight: 620;
160
- letter-spacing: -0.01em;
181
+ letter-spacing: #{mg.ref("tracking-tight")};
182
+ color: var(--vp-c-text-1);
183
+ transition: opacity #{mg.ref("motion-duration-fade")} #{mg.ref("motion-ease")};
161
184
  }
162
185
 
163
- .VPNavBarTitle .title:not(:has(.logo))::before {
164
- content: "";
165
- width: 0.5rem;
166
- height: 0.5rem;
167
- background: #{mg.ref("color-accent")};
186
+ // Wherever the bar runs out of room, the title text gives way first.
187
+ .VPNavBarTitle .title > span {
188
+ overflow: hidden;
189
+ text-overflow: ellipsis;
190
+ white-space: nowrap;
191
+ }
192
+
193
+ .VPNavBarTitle .logo {
194
+ flex: none;
195
+ height: var(--vp-nav-logo-height);
196
+ }
197
+
198
+ @include bp.up("md") {
199
+ .VPNavBarTitle .title {
200
+ flex-shrink: 0;
201
+ }
202
+
203
+ .VPNavBarTitle.has-sidebar {
204
+ max-width: calc(var(--vp-sidebar-width) - 4rem);
205
+ }
206
+ }
207
+
208
+ // Version switcher: a small framed tag beside the site name, set like the theme's labels. Its
209
+ // menu opens from its left edge, since the tag sits at the left of the bar. The space above the
210
+ // menu is padding, not an offset: VPFlyout closes as soon as the pointer leaves the button for
211
+ // anything outside the menu box, so a gap between the two would close it on the way down.
212
+
213
+ .ff-version-switcher {
214
+ flex: none;
215
+ }
216
+
217
+ .ff-version-switcher .button {
218
+ height: auto;
219
+ padding: 0.25rem 0.5rem;
220
+ border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
221
+ border-radius: #{mg.ref("radius-sm")};
222
+ transition: border-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
223
+ }
224
+
225
+ .ff-version-switcher .button:hover,
226
+ .ff-version-switcher .button[aria-expanded="true"] {
227
+ border-color: #{mg.ref("color-rule-strong")};
228
+ }
229
+
230
+ .ff-version-switcher .text {
231
+ font-family: #{mg.ref("font-mono")};
232
+ font-size: #{mg.ref("size-label")};
233
+ line-height: 1;
234
+ color: #{mg.ref("color-ink-muted")};
235
+ }
236
+
237
+ .ff-version-switcher .menu {
238
+ top: 100%;
239
+ inset-inline: 0 auto;
240
+ padding-top: 0.5rem;
168
241
  }
169
242
 
170
243
  // Menu links
171
244
 
172
245
  .VPNavBarMenuLink,
173
246
  .VPNavBarMenuGroup .button {
174
- font-size: 0.875rem;
247
+ font-size: #{mg.ref("size-ui")};
175
248
  font-weight: 500;
176
249
  color: #{mg.ref("color-ink-muted")};
177
250
  transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
@@ -184,15 +257,10 @@
184
257
 
185
258
  .VPNavBarMenuLink.active {
186
259
  color: #{mg.ref("color-ink")};
187
- text-decoration: underline;
188
- text-decoration-color: #{mg.ref("color-accent")};
189
- text-decoration-thickness: 2px;
190
- text-underline-offset: 0.5rem;
191
260
  }
192
261
 
193
262
  // Search trigger
194
263
 
195
- .VPNavBarSearch .DocSearch-Button,
196
264
  .VPNavBarSearchButton {
197
265
  display: flex;
198
266
  align-items: center;
@@ -202,9 +270,8 @@
202
270
  border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
203
271
  border-radius: #{mg.ref("radius-sm")};
204
272
  background: transparent;
205
- font-size: 0.8125rem;
273
+ font-size: #{mg.ref("size-small")};
206
274
  color: #{mg.ref("color-ink-faint")};
207
- transition: border-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
208
275
  }
209
276
 
210
277
  .VPNavBarSearchButton:hover {
@@ -212,8 +279,7 @@
212
279
  color: #{mg.ref("color-ink-muted")};
213
280
  }
214
281
 
215
- .VPNavBarSearchButton .keys kbd,
216
- .VPNavBarSearchButton .keys .key-cmd {
282
+ .VPNavBarSearchButton .keys kbd {
217
283
  border: 0;
218
284
  border-radius: 0;
219
285
  background: transparent;
@@ -232,13 +298,13 @@
232
298
  }
233
299
 
234
300
  .VPSwitch .check {
235
- border-radius: 2px;
301
+ border-radius: #{mg.ref("radius-xs")};
236
302
  background: #{mg.ref("color-surface-alt")};
237
303
  box-shadow: none;
238
304
  }
239
305
 
240
306
  .VPSwitch .icon {
241
- border-radius: 2px;
307
+ border-radius: #{mg.ref("radius-xs")};
242
308
  }
243
309
 
244
310
  // ----------------------------------------------------------------------------------------- //
@@ -278,7 +344,7 @@
278
344
  font-family: #{mg.ref("font-mono")};
279
345
  font-size: #{mg.ref("size-label")};
280
346
  text-transform: uppercase;
281
- letter-spacing: 0.06em;
347
+ letter-spacing: #{mg.ref("tracking-label-tight")};
282
348
  }
283
349
 
284
350
  .VPLocalSearchBox .titles .title {
@@ -0,0 +1,77 @@
1
+ // ============================================================================================= //
2
+ // PRINT //
3
+ // ============================================================================================= //
4
+
5
+ @use "theme" as mg;
6
+ @use "tokens";
7
+ @use "sass:map";
8
+
9
+ // Declared last in the stylesheet: the print palette re-emits the light tokens on the same
10
+ // selectors the dark scheme uses, so source order is what makes it win.
11
+
12
+ @media print {
13
+
14
+ // ----------------------------------------------------------------------------------------- //
15
+ // Light palette, whichever scheme the reader browses in
16
+ // ----------------------------------------------------------------------------------------- //
17
+
18
+ :root.dark {
19
+ @include mg.emit(tokens.$light);
20
+
21
+ color-scheme: light;
22
+ }
23
+
24
+ @each $name, $preset in tokens.$presets {
25
+ :root.dark[data-ff-preset="#{$name}"] {
26
+ @include mg.emit(tokens.preset-colors(map.get($preset, "light"), 0.09, 0.16));
27
+ }
28
+ }
29
+
30
+ // The default theme switches highlighted code to its dark colours on `.dark`.
31
+
32
+ :root.dark .shiki span {
33
+ color: var(--shiki-light, inherit);
34
+ font-weight: var(--shiki-light-font-weight, inherit);
35
+ text-decoration: var(--shiki-light-text-decoration, inherit);
36
+ }
37
+
38
+ // ----------------------------------------------------------------------------------------- //
39
+ // Chrome that means nothing on paper
40
+ // ----------------------------------------------------------------------------------------- //
41
+
42
+ .ff-theme {
43
+ .VPNav,
44
+ .VPLocalNav,
45
+ .VPSidebar,
46
+ .VPDoc .aside,
47
+ .VPDocFooter .prev-next,
48
+ .ff-banner,
49
+ .ff-to-top,
50
+ .ff-progress,
51
+ .ff-feedback {
52
+ display: none;
53
+ }
54
+
55
+ // The content wrapper made room for the fixed navigation, the sidebar and the banner.
56
+
57
+ .VPContent,
58
+ .VPContent.has-sidebar {
59
+ margin-top: 0;
60
+ padding-top: 0;
61
+ padding-right: 0;
62
+ padding-left: 0;
63
+ }
64
+
65
+ .VPDoc .container {
66
+ display: block;
67
+ }
68
+ }
69
+
70
+ // ----------------------------------------------------------------------------------------- //
71
+ // Links keep their destination
72
+ // ----------------------------------------------------------------------------------------- //
73
+
74
+ .vp-doc a[href^="http"]:not(.header-anchor)::after {
75
+ content: " (" attr(href) ")";
76
+ }
77
+ }