@frontfactory/vitepress-theme 1.6.0 → 1.8.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/CHANGELOG.md +214 -0
- package/README.md +160 -8
- package/config.d.ts +26 -1
- package/config.js +165 -21
- package/dist/style.css +1 -1
- package/node/llms.js +31 -0
- package/node/og.js +159 -0
- package/node/pages.js +154 -0
- package/node/rss.js +81 -0
- package/package.json +49 -26
- package/src/blog/posts.data.ts +46 -0
- package/src/components/FfBackToTop.vue +33 -10
- package/src/components/FfBanner.vue +42 -8
- package/src/components/FfCopyStatus.vue +64 -0
- package/src/components/FfDocMeta.vue +50 -46
- package/src/components/FfFeature.vue +18 -7
- package/src/components/FfFeedback.vue +96 -0
- package/src/components/FfFooter.vue +11 -5
- package/src/components/FfHero.vue +20 -10
- package/src/components/FfHeroCommand.vue +24 -27
- package/src/components/FfHomeSponsors.vue +2 -2
- package/src/components/FfNavBarTitle.vue +63 -0
- package/src/components/FfPost.vue +49 -0
- package/src/components/FfProgress.vue +69 -0
- package/src/components/FfVersionSwitcher.vue +20 -0
- package/src/composables/blog.ts +38 -0
- package/src/composables/options.ts +19 -14
- package/src/composables/relativeTime.ts +59 -0
- package/src/composables/tabs.ts +155 -0
- package/src/content/Api.vue +6 -2
- package/src/content/Badge.vue +26 -0
- package/src/content/Callout.vue +27 -0
- package/src/content/FileTree.vue +118 -0
- package/src/content/Tab.vue +11 -0
- package/src/content/Tabs.vue +74 -0
- package/src/content/Timeline.vue +19 -0
- package/src/content/TimelineItem.vue +37 -0
- package/src/content/timeline.ts +4 -0
- package/src/index.ts +37 -1
- package/src/internal.ts +7 -2
- package/src/layout/FfBlog.vue +62 -0
- package/src/layout/FfLayout.vue +17 -1
- package/src/styles/_base.scss +20 -5
- package/src/styles/_blocks.scss +25 -1
- package/src/styles/_blog.scss +131 -0
- package/src/styles/_breakpoints.scss +26 -0
- package/src/styles/_code.scss +5 -5
- package/src/styles/_content.scss +280 -12
- package/src/styles/_doc.scss +18 -5
- package/src/styles/_home.scss +37 -17
- package/src/styles/_motion.scss +22 -2
- package/src/styles/_nav.scss +81 -8
- package/src/styles/_print.scss +77 -0
- package/src/styles/_sidebar.scss +2 -2
- package/src/styles/_tokens.scss +75 -9
- package/src/styles/index.scss +2 -0
- package/src/types.ts +140 -2
- package/types/blog/posts.data.d.ts +14 -0
- package/types/components/FfBackToTop.vue.d.ts +3 -0
- package/types/components/FfBanner.vue.d.ts +3 -0
- package/types/components/FfCopyStatus.vue.d.ts +3 -0
- package/types/components/FfDocMeta.vue.d.ts +3 -0
- package/types/components/FfFeature.vue.d.ts +13 -0
- package/types/components/FfFeedback.vue.d.ts +3 -0
- package/types/components/FfFooter.vue.d.ts +3 -0
- package/types/components/FfHero.vue.d.ts +42 -0
- package/types/components/FfHeroCommand.vue.d.ts +9 -0
- package/types/components/FfHomeSponsors.vue.d.ts +19 -0
- package/types/components/FfNavBarTitle.vue.d.ts +17 -0
- package/types/components/FfPost.vue.d.ts +3 -0
- package/types/components/FfProgress.vue.d.ts +3 -0
- package/types/components/FfVersionSwitcher.vue.d.ts +3 -0
- package/types/composables/blog.d.ts +10 -0
- package/types/composables/link.d.ts +12 -0
- package/types/composables/options.d.ts +15 -0
- package/types/composables/relativeTime.d.ts +2 -0
- package/types/composables/tabs.d.ts +15 -0
- package/types/content/Api.vue.d.ts +27 -0
- package/types/content/Badge.vue.d.ts +21 -0
- package/types/content/Callout.vue.d.ts +24 -0
- package/types/content/Card.vue.d.ts +23 -0
- package/types/content/CardGrid.vue.d.ts +20 -0
- package/types/content/FileTree.vue.d.ts +6 -0
- package/types/content/Kbd.vue.d.ts +15 -0
- package/types/content/Steps.vue.d.ts +15 -0
- package/types/content/Tab.vue.d.ts +19 -0
- package/types/content/Tabs.vue.d.ts +7 -0
- package/types/content/Timeline.vue.d.ts +21 -0
- package/types/content/TimelineItem.vue.d.ts +21 -0
- package/types/content/timeline.d.ts +3 -0
- package/types/index.d.ts +25 -0
- package/types/internal.d.ts +9 -0
- package/types/layout/FfBlog.vue.d.ts +3 -0
- package/types/layout/FfLayout.vue.d.ts +23 -0
- package/types/types.d.ts +256 -0
package/src/styles/_home.scss
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// HOME //
|
|
3
3
|
// ============================================================================================= //
|
|
4
4
|
|
|
5
|
+
@use "breakpoints" as bp;
|
|
5
6
|
@use "theme" as mg;
|
|
6
7
|
|
|
7
8
|
.ff-theme {
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
164
165
|
border-radius: #{mg.ref("radius-md")};
|
|
165
166
|
background: #{mg.ref("color-surface")};
|
|
166
|
-
box-shadow: 0 1.5rem 3rem
|
|
167
|
+
box-shadow: 0 1.5rem 3rem #{mg.ref("color-shadow-sm")};
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
.ff-hero-panel-label {
|
|
@@ -321,9 +322,6 @@
|
|
|
321
322
|
background-repeat: no-repeat;
|
|
322
323
|
background-size: 0.875rem;
|
|
323
324
|
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
325
|
}
|
|
328
326
|
|
|
329
327
|
.ff-hero-copy:hover {
|
|
@@ -354,7 +352,7 @@
|
|
|
354
352
|
height: auto;
|
|
355
353
|
}
|
|
356
354
|
|
|
357
|
-
@
|
|
355
|
+
@include bp.up("md") {
|
|
358
356
|
.ff-hero-image {
|
|
359
357
|
max-width: none;
|
|
360
358
|
}
|
|
@@ -398,13 +396,13 @@
|
|
|
398
396
|
color: #{mg.ref("color-ink")};
|
|
399
397
|
}
|
|
400
398
|
|
|
401
|
-
@
|
|
399
|
+
@include bp.up("sm") {
|
|
402
400
|
.ff-hero {
|
|
403
401
|
padding: calc(var(--ff-hero-offset) + 2rem) 3rem 4rem;
|
|
404
402
|
}
|
|
405
403
|
}
|
|
406
404
|
|
|
407
|
-
@
|
|
405
|
+
@include bp.up("md") {
|
|
408
406
|
.ff-hero {
|
|
409
407
|
padding: calc(var(--ff-hero-offset) + 2.25rem) 4rem 4.5rem;
|
|
410
408
|
}
|
|
@@ -542,7 +540,7 @@
|
|
|
542
540
|
transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
|
|
543
541
|
}
|
|
544
542
|
|
|
545
|
-
|
|
543
|
+
.ff-feature-linked:hover .ff-feature-index::before {
|
|
546
544
|
color: #{mg.ref("color-accent")};
|
|
547
545
|
}
|
|
548
546
|
|
|
@@ -566,6 +564,28 @@
|
|
|
566
564
|
color: #{mg.ref("color-ink")};
|
|
567
565
|
}
|
|
568
566
|
|
|
567
|
+
.ff-feature-anchor {
|
|
568
|
+
color: inherit;
|
|
569
|
+
text-decoration: none;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// Stretched over the whole card, so it stays clickable everywhere.
|
|
573
|
+
.ff-feature-anchor::before {
|
|
574
|
+
content: "";
|
|
575
|
+
position: absolute;
|
|
576
|
+
inset: 0;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// The focus ring goes around the card the link covers, not around the title alone.
|
|
580
|
+
.ff-feature-anchor:focus-visible {
|
|
581
|
+
outline: none;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.ff-feature:has(.ff-feature-anchor:focus-visible) {
|
|
585
|
+
outline: 2px solid #{mg.ref("color-accent")};
|
|
586
|
+
outline-offset: -2px;
|
|
587
|
+
}
|
|
588
|
+
|
|
569
589
|
.ff-feature-icon + .ff-feature-title {
|
|
570
590
|
margin-top: 1.5rem;
|
|
571
591
|
}
|
|
@@ -589,7 +609,7 @@
|
|
|
589
609
|
color: #{mg.ref("color-accent")};
|
|
590
610
|
}
|
|
591
611
|
|
|
592
|
-
@
|
|
612
|
+
@include bp.up("sm") {
|
|
593
613
|
.VPFeatures {
|
|
594
614
|
padding: 3rem 3rem 3.5rem;
|
|
595
615
|
}
|
|
@@ -599,7 +619,7 @@
|
|
|
599
619
|
}
|
|
600
620
|
}
|
|
601
621
|
|
|
602
|
-
@
|
|
622
|
+
@include bp.up("md") {
|
|
603
623
|
.VPFeatures {
|
|
604
624
|
padding: 3.5rem 4rem 4rem;
|
|
605
625
|
}
|
|
@@ -699,12 +719,12 @@
|
|
|
699
719
|
// dead padding. Fixed values here instead, sized so the mark actually fills its tile.
|
|
700
720
|
|
|
701
721
|
.ff-sponsors-grid .vp-sponsor-grid-link {
|
|
702
|
-
min-height:
|
|
722
|
+
min-height: 5.625rem;
|
|
703
723
|
}
|
|
704
724
|
|
|
705
725
|
.ff-sponsors-grid .vp-sponsor-grid-image {
|
|
706
|
-
max-width:
|
|
707
|
-
max-height:
|
|
726
|
+
max-width: 7.5rem;
|
|
727
|
+
max-height: 2rem;
|
|
708
728
|
}
|
|
709
729
|
|
|
710
730
|
// Same background band as the default (`--vp-c-bg-soft`, already remapped to the theme's own
|
|
@@ -715,11 +735,11 @@
|
|
|
715
735
|
display: flex;
|
|
716
736
|
align-items: center;
|
|
717
737
|
justify-content: flex-start;
|
|
718
|
-
height:
|
|
738
|
+
height: 3.75rem;
|
|
719
739
|
margin: 0 0 0.25rem;
|
|
720
740
|
padding: 0 1.25rem;
|
|
721
741
|
font-family: #{mg.ref("font-mono")};
|
|
722
|
-
font-size:
|
|
742
|
+
font-size: 0.875rem;
|
|
723
743
|
font-weight: 500;
|
|
724
744
|
letter-spacing: #{mg.ref("tracking-label")};
|
|
725
745
|
text-align: left;
|
|
@@ -731,7 +751,7 @@
|
|
|
731
751
|
margin-top: 2rem;
|
|
732
752
|
}
|
|
733
753
|
|
|
734
|
-
@
|
|
754
|
+
@include bp.up("sm") {
|
|
735
755
|
.ff-sponsors {
|
|
736
756
|
padding: 3rem 3rem 3.5rem;
|
|
737
757
|
}
|
|
@@ -742,7 +762,7 @@
|
|
|
742
762
|
}
|
|
743
763
|
}
|
|
744
764
|
|
|
745
|
-
@
|
|
765
|
+
@include bp.up("md") {
|
|
746
766
|
.ff-sponsors {
|
|
747
767
|
padding: 3.5rem 4rem 4rem;
|
|
748
768
|
}
|
package/src/styles/_motion.scss
CHANGED
|
@@ -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,7 +56,7 @@
|
|
|
48
56
|
.ff-hero-panel,
|
|
49
57
|
.ff-hero-meta,
|
|
50
58
|
.ff-hero-image {
|
|
51
|
-
animation: ff-rise
|
|
59
|
+
animation: ff-rise #{mg.ref("motion-duration-enter")} #{mg.ref("motion-ease")} both;
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
.ff-hero-title {
|
|
@@ -152,7 +160,7 @@
|
|
|
152
160
|
transition: opacity #{mg.ref("motion-duration-slow")} #{mg.ref("motion-ease")};
|
|
153
161
|
}
|
|
154
162
|
|
|
155
|
-
|
|
163
|
+
.ff-feature-linked:hover::after {
|
|
156
164
|
opacity: 1;
|
|
157
165
|
}
|
|
158
166
|
|
|
@@ -213,3 +221,15 @@
|
|
|
213
221
|
transform #{mg.ref("motion-duration-slow")} #{mg.ref("motion-ease")};
|
|
214
222
|
}
|
|
215
223
|
}
|
|
224
|
+
|
|
225
|
+
@media (prefers-reduced-motion: reduce) {
|
|
226
|
+
.ff-theme {
|
|
227
|
+
.ff-to-top,
|
|
228
|
+
.ff-hero-command-tab,
|
|
229
|
+
.ff-hero-command-tab::after,
|
|
230
|
+
.ff-hero-copy,
|
|
231
|
+
.VPNavBarMenuLink::after {
|
|
232
|
+
transition: none;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
package/src/styles/_nav.scss
CHANGED
|
@@ -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
|
-
@
|
|
41
|
+
@include bp.up("md") {
|
|
41
42
|
&[data-nav-sticky="false"] .VPContent {
|
|
42
43
|
padding-top: 0;
|
|
43
44
|
}
|
|
@@ -107,13 +108,13 @@
|
|
|
107
108
|
// The gutters have to match the ones the hero uses, or the bar lands a few pixels off the
|
|
108
109
|
// content it sits above.
|
|
109
110
|
|
|
110
|
-
@
|
|
111
|
+
@include bp.up("sm") {
|
|
111
112
|
.VPNavBar:not(.has-sidebar) .wrapper {
|
|
112
113
|
padding: 0 3rem;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
@
|
|
117
|
+
@include bp.up("md") {
|
|
117
118
|
.VPNavBar:not(.has-sidebar) .wrapper {
|
|
118
119
|
padding: 0 4rem;
|
|
119
120
|
}
|
|
@@ -167,6 +168,82 @@
|
|
|
167
168
|
background: #{mg.ref("color-accent")};
|
|
168
169
|
}
|
|
169
170
|
|
|
171
|
+
// FfNavBarTitle replaces the default title, whose scoped layout rules go with it: they are
|
|
172
|
+
// restated here, with the row now holding the title link and the version switcher.
|
|
173
|
+
|
|
174
|
+
.VPNavBarTitle {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: 0.75rem;
|
|
178
|
+
height: var(--vp-nav-height);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.VPNavBarTitle .title {
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
min-width: 0;
|
|
185
|
+
height: 100%;
|
|
186
|
+
color: var(--vp-c-text-1);
|
|
187
|
+
transition: opacity 0.25s;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Wherever the bar runs out of room, the title text gives way first.
|
|
191
|
+
.VPNavBarTitle .title > span {
|
|
192
|
+
overflow: hidden;
|
|
193
|
+
text-overflow: ellipsis;
|
|
194
|
+
white-space: nowrap;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.VPNavBarTitle .logo {
|
|
198
|
+
flex: none;
|
|
199
|
+
height: var(--vp-nav-logo-height);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@include bp.up("md") {
|
|
203
|
+
.VPNavBarTitle .title {
|
|
204
|
+
flex-shrink: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.VPNavBarTitle.has-sidebar {
|
|
208
|
+
max-width: calc(var(--vp-sidebar-width) - 4rem);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Version switcher: a small framed tag beside the site name, set like the theme's labels. Its
|
|
213
|
+
// menu opens from its left edge, since the tag sits at the left of the bar. The space above the
|
|
214
|
+
// menu is padding, not an offset: VPFlyout closes as soon as the pointer leaves the button for
|
|
215
|
+
// anything outside the menu box, so a gap between the two would close it on the way down.
|
|
216
|
+
|
|
217
|
+
.ff-version-switcher {
|
|
218
|
+
flex: none;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ff-version-switcher .button {
|
|
222
|
+
height: auto;
|
|
223
|
+
padding: 0.25rem 0.5rem;
|
|
224
|
+
border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
225
|
+
border-radius: #{mg.ref("radius-sm")};
|
|
226
|
+
transition: border-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.ff-version-switcher .button:hover,
|
|
230
|
+
.ff-version-switcher .button[aria-expanded="true"] {
|
|
231
|
+
border-color: #{mg.ref("color-rule-strong")};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.ff-version-switcher .text {
|
|
235
|
+
font-family: #{mg.ref("font-mono")};
|
|
236
|
+
font-size: #{mg.ref("size-label")};
|
|
237
|
+
line-height: 1;
|
|
238
|
+
color: #{mg.ref("color-ink-muted")};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.ff-version-switcher .menu {
|
|
242
|
+
top: 100%;
|
|
243
|
+
inset-inline: 0 auto;
|
|
244
|
+
padding-top: 0.5rem;
|
|
245
|
+
}
|
|
246
|
+
|
|
170
247
|
// Menu links
|
|
171
248
|
|
|
172
249
|
.VPNavBarMenuLink,
|
|
@@ -184,10 +261,6 @@
|
|
|
184
261
|
|
|
185
262
|
.VPNavBarMenuLink.active {
|
|
186
263
|
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
264
|
}
|
|
192
265
|
|
|
193
266
|
// Search trigger
|
|
@@ -278,7 +351,7 @@
|
|
|
278
351
|
font-family: #{mg.ref("font-mono")};
|
|
279
352
|
font-size: #{mg.ref("size-label")};
|
|
280
353
|
text-transform: uppercase;
|
|
281
|
-
letter-spacing:
|
|
354
|
+
letter-spacing: #{mg.ref("tracking-label-tight")};
|
|
282
355
|
}
|
|
283
356
|
|
|
284
357
|
.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
|
+
}
|
package/src/styles/_sidebar.scss
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
font-weight: 600;
|
|
77
77
|
line-height: 1.4;
|
|
78
78
|
text-transform: uppercase;
|
|
79
|
-
letter-spacing:
|
|
79
|
+
letter-spacing: #{mg.ref("tracking-label-wide")};
|
|
80
80
|
color: #{mg.ref("color-ink")};
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
font-size: #{mg.ref("size-label")};
|
|
111
111
|
font-weight: 600;
|
|
112
112
|
text-transform: uppercase;
|
|
113
|
-
letter-spacing:
|
|
113
|
+
letter-spacing: #{mg.ref("tracking-label-tight")};
|
|
114
114
|
color: #{mg.ref("color-ink-faint")};
|
|
115
115
|
}
|
|
116
116
|
|
package/src/styles/_tokens.scss
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// TOKENS //
|
|
3
3
|
// ============================================================================================= //
|
|
4
4
|
|
|
5
|
+
@use "sass:color";
|
|
6
|
+
@use "sass:list";
|
|
7
|
+
@use "sass:map";
|
|
5
8
|
@use "theme" as mg;
|
|
6
9
|
|
|
7
10
|
// --------------------------------------------------------------------------------------------- //
|
|
@@ -24,7 +27,9 @@ $scales: (
|
|
|
24
27
|
),
|
|
25
28
|
"tracking": (
|
|
26
29
|
"display": -0.025em,
|
|
27
|
-
"label": 0.1em
|
|
30
|
+
"label": 0.1em,
|
|
31
|
+
"label-tight": 0.06em,
|
|
32
|
+
"label-wide": 0.08em
|
|
28
33
|
),
|
|
29
34
|
"size": (
|
|
30
35
|
"label": 0.6875rem,
|
|
@@ -51,6 +56,7 @@ $scales: (
|
|
|
51
56
|
"motion": (
|
|
52
57
|
"duration": 200ms,
|
|
53
58
|
"duration-slow": 420ms,
|
|
59
|
+
"duration-enter": 650ms,
|
|
54
60
|
"ease": cubic-bezier(0.2, 0.6, 0.2, 1)
|
|
55
61
|
),
|
|
56
62
|
"banner": (
|
|
@@ -83,7 +89,7 @@ $light: (
|
|
|
83
89
|
"surface-alt": #f4f2ee,
|
|
84
90
|
"ink": #1a1917,
|
|
85
91
|
"ink-muted": #55524c,
|
|
86
|
-
"ink-faint": #
|
|
92
|
+
"ink-faint": #6b665e,
|
|
87
93
|
"rule": #e6e2da,
|
|
88
94
|
"rule-strong": #d3cec4,
|
|
89
95
|
"accent": #2745cf,
|
|
@@ -93,7 +99,11 @@ $light: (
|
|
|
93
99
|
"accent-glow": rgb(39 69 207 / 0.16),
|
|
94
100
|
"success": #1c7a52,
|
|
95
101
|
"warning": #8a5a00,
|
|
96
|
-
"danger": #b32835
|
|
102
|
+
"danger": #b32835,
|
|
103
|
+
"shadow-sm": rgb(0 0 0 / 0.05),
|
|
104
|
+
"shadow-md": rgb(0 0 0 / 0.08),
|
|
105
|
+
"shadow-lg": rgb(0 0 0 / 0.1),
|
|
106
|
+
"shadow-xl": rgb(0 0 0 / 0.12)
|
|
97
107
|
)
|
|
98
108
|
);
|
|
99
109
|
|
|
@@ -104,7 +114,7 @@ $dark: (
|
|
|
104
114
|
"surface-alt": #201e1b,
|
|
105
115
|
"ink": #ece9e3,
|
|
106
116
|
"ink-muted": #a5a099,
|
|
107
|
-
"ink-faint": #
|
|
117
|
+
"ink-faint": #8f8a82,
|
|
108
118
|
"rule": #2c2a26,
|
|
109
119
|
"rule-strong": #423e38,
|
|
110
120
|
"accent": #94a8ff,
|
|
@@ -114,7 +124,11 @@ $dark: (
|
|
|
114
124
|
"accent-glow": rgb(148 168 255 / 0.2),
|
|
115
125
|
"success": #4ac48b,
|
|
116
126
|
"warning": #e0a942,
|
|
117
|
-
"danger": #f0707f
|
|
127
|
+
"danger": #f0707f,
|
|
128
|
+
"shadow-sm": rgb(0 0 0 / 0.3),
|
|
129
|
+
"shadow-md": rgb(0 0 0 / 0.4),
|
|
130
|
+
"shadow-lg": rgb(0 0 0 / 0.45),
|
|
131
|
+
"shadow-xl": rgb(0 0 0 / 0.5)
|
|
118
132
|
)
|
|
119
133
|
);
|
|
120
134
|
|
|
@@ -135,6 +149,58 @@ $dark: (
|
|
|
135
149
|
color-scheme: dark;
|
|
136
150
|
}
|
|
137
151
|
|
|
152
|
+
// --------------------------------------------------------------------------------------------- //
|
|
153
|
+
// Accent presets
|
|
154
|
+
//
|
|
155
|
+
// Ready-made accents picked with `themeConfig.ff.preset`, which sets data-ff-preset on <html>.
|
|
156
|
+
// Each one is an accent and its hover per scheme; the soft and glow washes derive from the accent.
|
|
157
|
+
// The light accents keep at least 4.5:1 against both the paper and white text on top of them.
|
|
158
|
+
// --------------------------------------------------------------------------------------------- //
|
|
159
|
+
|
|
160
|
+
$presets: (
|
|
161
|
+
"emerald": (
|
|
162
|
+
"light": (#0f7a55, #0b5e41, #fff),
|
|
163
|
+
"dark": (#4fd1a1, #7fe0bc, #0c1512)
|
|
164
|
+
),
|
|
165
|
+
"crimson": (
|
|
166
|
+
"light": (#b4233c, #8f1a2f, #fff),
|
|
167
|
+
"dark": (#ff8a9b, #ffb0bc, #1a0d10)
|
|
168
|
+
),
|
|
169
|
+
"violet": (
|
|
170
|
+
"light": (#6d3fd1, #5530a8, #fff),
|
|
171
|
+
"dark": (#b9a2ff, #d0c2ff, #140f20)
|
|
172
|
+
),
|
|
173
|
+
"amber": (
|
|
174
|
+
"light": (#a35200, #7f3f00, #fff),
|
|
175
|
+
"dark": (#f5b452, #f8ca82, #1a1206)
|
|
176
|
+
)
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
@function preset-colors($colors, $soft, $glow) {
|
|
180
|
+
$accent: list.nth($colors, 1);
|
|
181
|
+
|
|
182
|
+
@return (
|
|
183
|
+
"color": (
|
|
184
|
+
"accent": $accent,
|
|
185
|
+
"accent-hover": list.nth($colors, 2),
|
|
186
|
+
"accent-contrast": list.nth($colors, 3),
|
|
187
|
+
"accent-soft": color.change($accent, $alpha: $soft),
|
|
188
|
+
"accent-glow": color.change($accent, $alpha: $glow)
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// The dark selector carries the attribute too, so it outweighs the light preset rule.
|
|
194
|
+
@each $name, $preset in $presets {
|
|
195
|
+
:root[data-ff-preset="#{$name}"] {
|
|
196
|
+
@include mg.emit(preset-colors(map.get($preset, "light"), 0.09, 0.16));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:root.dark[data-ff-preset="#{$name}"] {
|
|
200
|
+
@include mg.emit(preset-colors(map.get($preset, "dark"), 0.13, 0.2));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
138
204
|
// --------------------------------------------------------------------------------------------- //
|
|
139
205
|
// Bridge to the VitePress default theme
|
|
140
206
|
//
|
|
@@ -179,9 +245,9 @@ $dark: (
|
|
|
179
245
|
/* Elevation is a hairline job here — only overlays keep a shadow. */
|
|
180
246
|
--vp-shadow-1: none;
|
|
181
247
|
--vp-shadow-2: none;
|
|
182
|
-
--vp-shadow-3: 0 16px 40px
|
|
183
|
-
--vp-shadow-4: 0 16px 40px
|
|
184
|
-
--vp-shadow-5: 0 24px 64px
|
|
248
|
+
--vp-shadow-3: 0 16px 40px #{mg.ref("color-shadow-md")};
|
|
249
|
+
--vp-shadow-4: 0 16px 40px #{mg.ref("color-shadow-lg")};
|
|
250
|
+
--vp-shadow-5: 0 24px 64px #{mg.ref("color-shadow-xl")};
|
|
185
251
|
|
|
186
252
|
/**
|
|
187
253
|
* Distance from the edge of the viewport to the content band — the frame the whole theme is
|
|
@@ -197,7 +263,7 @@ $dark: (
|
|
|
197
263
|
*/
|
|
198
264
|
--vp-nav-bg-color: #{mg.ref("color-paper")};
|
|
199
265
|
--vp-nav-backdrop-filter: none;
|
|
200
|
-
--vp-layout-max-width:
|
|
266
|
+
--vp-layout-max-width: #{mg.ref("layout-wide")};
|
|
201
267
|
--vp-sidebar-width: 15rem;
|
|
202
268
|
--vp-header-anchor-symbol: "#";
|
|
203
269
|
--vp-code-font-size: 0.8125em;
|