@frontfactory/vitepress-theme 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/config.d.ts +4 -4
- package/config.js +39 -17
- package/dist/style.css +1 -2011
- package/package.json +15 -6
- package/src/components/FfBackToTop.vue +37 -30
- package/src/components/FfBanner.vue +64 -50
- package/src/components/FfDocMeta.vue +107 -55
- package/src/components/FfFeature.vue +58 -26
- package/src/components/FfFooter.vue +97 -51
- package/src/components/FfHero.vue +168 -109
- package/src/components/FfHeroCommand.vue +66 -47
- package/src/components/FfHomeSponsors.vue +30 -14
- package/src/composables/options.ts +23 -14
- package/src/content/Api.vue +30 -13
- package/src/content/Card.vue +22 -16
- package/src/content/CardGrid.vue +9 -4
- package/src/content/Kbd.vue +1 -1
- package/src/content/Steps.vue +3 -3
- package/src/index.ts +25 -23
- package/src/internal.ts +5 -5
- package/src/layout/FfLayout.vue +45 -34
- package/src/styles/_blocks.scss +1 -0
- package/src/styles/_code.scss +1 -0
- package/src/styles/_content.scss +8 -2
- package/src/styles/_doc.scss +7 -6
- package/src/styles/_home.scss +13 -8
- package/src/styles/_motion.scss +1 -0
- package/src/styles/_nav.scss +5 -3
- package/src/styles/_sidebar.scss +1 -0
- package/src/styles/_tokens.scss +15 -26
- package/src/types.ts +2 -2
package/src/styles/_home.scss
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@use "theme" as mg;
|
|
6
6
|
|
|
7
7
|
.ff-theme {
|
|
8
|
+
|
|
8
9
|
// ----------------------------------------------------------------------------------------- //
|
|
9
10
|
// Hero
|
|
10
11
|
//
|
|
@@ -101,6 +102,7 @@
|
|
|
101
102
|
font-family: #{mg.ref("font-title")};
|
|
102
103
|
font-size: #{mg.ref("size-hero")};
|
|
103
104
|
font-weight: 600;
|
|
105
|
+
|
|
104
106
|
// Capitals on a monospaced face put every glyph on the same square cell — the blockiest
|
|
105
107
|
// the headline can get without shipping a webfont. A monospaced face already sets its own
|
|
106
108
|
// cell width, so at this size the capitals need no tracking added on top. The word gap is
|
|
@@ -161,7 +163,7 @@
|
|
|
161
163
|
border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
|
|
162
164
|
border-radius: #{mg.ref("radius-md")};
|
|
163
165
|
background: #{mg.ref("color-surface")};
|
|
164
|
-
box-shadow: 0 1.5rem 3rem rgb(0 0 0 /
|
|
166
|
+
box-shadow: 0 1.5rem 3rem rgb(0 0 0 / 0.05);
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
.ff-hero-panel-label {
|
|
@@ -340,6 +342,7 @@
|
|
|
340
342
|
display: flex;
|
|
341
343
|
align-items: center;
|
|
342
344
|
justify-content: center;
|
|
345
|
+
|
|
343
346
|
// Caps it against the viewport rather than the column: at narrow widths the column itself
|
|
344
347
|
// is the limit; past 960px the column is half the hero, wide enough that this is the one
|
|
345
348
|
// that bites, so the image can run as large as the site's own picture allows.
|
|
@@ -351,7 +354,7 @@
|
|
|
351
354
|
height: auto;
|
|
352
355
|
}
|
|
353
356
|
|
|
354
|
-
@media (
|
|
357
|
+
@media (width >= 960px) {
|
|
355
358
|
.ff-hero-image {
|
|
356
359
|
max-width: none;
|
|
357
360
|
}
|
|
@@ -395,13 +398,13 @@
|
|
|
395
398
|
color: #{mg.ref("color-ink")};
|
|
396
399
|
}
|
|
397
400
|
|
|
398
|
-
@media (
|
|
401
|
+
@media (width >= 640px) {
|
|
399
402
|
.ff-hero {
|
|
400
403
|
padding: calc(var(--ff-hero-offset) + 2rem) 3rem 4rem;
|
|
401
404
|
}
|
|
402
405
|
}
|
|
403
406
|
|
|
404
|
-
@media (
|
|
407
|
+
@media (width >= 960px) {
|
|
405
408
|
.ff-hero {
|
|
406
409
|
padding: calc(var(--ff-hero-offset) + 2.25rem) 4rem 4.5rem;
|
|
407
410
|
}
|
|
@@ -586,7 +589,7 @@
|
|
|
586
589
|
color: #{mg.ref("color-accent")};
|
|
587
590
|
}
|
|
588
591
|
|
|
589
|
-
@media (
|
|
592
|
+
@media (width >= 640px) {
|
|
590
593
|
.VPFeatures {
|
|
591
594
|
padding: 3rem 3rem 3.5rem;
|
|
592
595
|
}
|
|
@@ -596,7 +599,7 @@
|
|
|
596
599
|
}
|
|
597
600
|
}
|
|
598
601
|
|
|
599
|
-
@media (
|
|
602
|
+
@media (width >= 960px) {
|
|
600
603
|
.VPFeatures {
|
|
601
604
|
padding: 3.5rem 4rem 4rem;
|
|
602
605
|
}
|
|
@@ -622,6 +625,7 @@
|
|
|
622
625
|
// ----------------------------------------------------------------------------------------- //
|
|
623
626
|
|
|
624
627
|
.ff-sponsors {
|
|
628
|
+
|
|
625
629
|
// Matches `.VPFeatures`'s own padding exactly, top/bottom included, so the two sections
|
|
626
630
|
// read as one continuous rhythm rather than the sponsors block sitting noticeably taller.
|
|
627
631
|
padding: 2.5rem 1.5rem 3rem;
|
|
@@ -668,6 +672,7 @@
|
|
|
668
672
|
}
|
|
669
673
|
|
|
670
674
|
.ff-sponsors-message {
|
|
675
|
+
|
|
671
676
|
// Matches `.ff-hero-tagline`'s measure — 32ch was breaking this sentence into an unbalanced
|
|
672
677
|
// two-line stub.
|
|
673
678
|
max-width: 42ch;
|
|
@@ -726,7 +731,7 @@
|
|
|
726
731
|
margin-top: 2rem;
|
|
727
732
|
}
|
|
728
733
|
|
|
729
|
-
@media (
|
|
734
|
+
@media (width >= 640px) {
|
|
730
735
|
.ff-sponsors {
|
|
731
736
|
padding: 3rem 3rem 3.5rem;
|
|
732
737
|
}
|
|
@@ -737,7 +742,7 @@
|
|
|
737
742
|
}
|
|
738
743
|
}
|
|
739
744
|
|
|
740
|
-
@media (
|
|
745
|
+
@media (width >= 960px) {
|
|
741
746
|
.ff-sponsors {
|
|
742
747
|
padding: 3.5rem 4rem 4rem;
|
|
743
748
|
}
|
package/src/styles/_motion.scss
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
@media (prefers-reduced-motion: no-preference) {
|
|
34
34
|
.ff-theme {
|
|
35
|
+
|
|
35
36
|
// ------------------------------------------------------------------------------------- //
|
|
36
37
|
// The hero lights up and settles
|
|
37
38
|
// ------------------------------------------------------------------------------------- //
|
package/src/styles/_nav.scss
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@use "theme" as mg;
|
|
6
6
|
|
|
7
7
|
.ff-theme {
|
|
8
|
+
|
|
8
9
|
// ----------------------------------------------------------------------------------------- //
|
|
9
10
|
// Top bar
|
|
10
11
|
// ----------------------------------------------------------------------------------------- //
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
margin-top: 0;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
@media (
|
|
40
|
+
@media (width >= 960px) {
|
|
40
41
|
&[data-nav-sticky="false"] .VPContent {
|
|
41
42
|
padding-top: 0;
|
|
42
43
|
}
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
.menu {
|
|
57
58
|
order: 1;
|
|
58
59
|
flex-grow: 0;
|
|
60
|
+
|
|
59
61
|
// Search owes its own breathing room from the title to its box's border and padding;
|
|
60
62
|
// plain text links have neither, so without this they sit right against the title.
|
|
61
63
|
margin-left: 1.5rem;
|
|
@@ -105,13 +107,13 @@
|
|
|
105
107
|
// The gutters have to match the ones the hero uses, or the bar lands a few pixels off the
|
|
106
108
|
// content it sits above.
|
|
107
109
|
|
|
108
|
-
@media (
|
|
110
|
+
@media (width >= 640px) {
|
|
109
111
|
.VPNavBar:not(.has-sidebar) .wrapper {
|
|
110
112
|
padding: 0 3rem;
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
@media (
|
|
116
|
+
@media (width >= 960px) {
|
|
115
117
|
.VPNavBar:not(.has-sidebar) .wrapper {
|
|
116
118
|
padding: 0 4rem;
|
|
117
119
|
}
|
package/src/styles/_sidebar.scss
CHANGED
package/src/styles/_tokens.scss
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
$scales: (
|
|
15
15
|
"font": (
|
|
16
|
-
"display": (
|
|
16
|
+
"display": (inter, ui-sans-serif, system-ui, sans-serif),
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/* The hero headline only. It borrows the mono the theme already speaks in its labels,*/
|
|
19
|
+
/* section numbers and install line, so the front page sounds like the tool it documents.*/
|
|
20
20
|
"title": var(--vp-font-family-mono),
|
|
21
21
|
|
|
22
22
|
"body": var(--vp-font-family-base),
|
|
@@ -57,9 +57,9 @@ $scales: (
|
|
|
57
57
|
"height": 2.6875rem
|
|
58
58
|
),
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
/* The two washes of light behind the hero. Off by default: they are a house style, not a*/
|
|
61
|
+
/* structural part of the layout, and they read as noise under a headline that is already*/
|
|
62
|
+
/* carried by its type. A site opts in by setting this to 1, or to anything in between.*/
|
|
63
63
|
"hero": (
|
|
64
64
|
"glow-opacity": 0
|
|
65
65
|
),
|
|
@@ -79,7 +79,7 @@ $scales: (
|
|
|
79
79
|
$light: (
|
|
80
80
|
"color": (
|
|
81
81
|
"paper": #fbfaf8,
|
|
82
|
-
"surface": #
|
|
82
|
+
"surface": #fff,
|
|
83
83
|
"surface-alt": #f4f2ee,
|
|
84
84
|
"ink": #1a1917,
|
|
85
85
|
"ink-muted": #55524c,
|
|
@@ -88,9 +88,9 @@ $light: (
|
|
|
88
88
|
"rule-strong": #d3cec4,
|
|
89
89
|
"accent": #2745cf,
|
|
90
90
|
"accent-hover": #1b34a8,
|
|
91
|
-
"accent-contrast": #
|
|
92
|
-
"accent-soft":
|
|
93
|
-
"accent-glow":
|
|
91
|
+
"accent-contrast": #fff,
|
|
92
|
+
"accent-soft": rgb(39 69 207 / 0.09),
|
|
93
|
+
"accent-glow": rgb(39 69 207 / 0.16),
|
|
94
94
|
"success": #1c7a52,
|
|
95
95
|
"warning": #8a5a00,
|
|
96
96
|
"danger": #b32835
|
|
@@ -110,8 +110,8 @@ $dark: (
|
|
|
110
110
|
"accent": #94a8ff,
|
|
111
111
|
"accent-hover": #b5c2ff,
|
|
112
112
|
"accent-contrast": #101018,
|
|
113
|
-
"accent-soft":
|
|
114
|
-
"accent-glow":
|
|
113
|
+
"accent-soft": rgb(148 168 255 / 0.13),
|
|
114
|
+
"accent-glow": rgb(148 168 255 / 0.2),
|
|
115
115
|
"success": #4ac48b,
|
|
116
116
|
"warning": #e0a942,
|
|
117
117
|
"danger": #f0707f
|
|
@@ -147,25 +147,20 @@ $dark: (
|
|
|
147
147
|
--vp-c-bg-alt: #{mg.ref("color-surface-alt")};
|
|
148
148
|
--vp-c-bg-elv: #{mg.ref("color-surface")};
|
|
149
149
|
--vp-c-bg-soft: #{mg.ref("color-surface-alt")};
|
|
150
|
-
|
|
151
150
|
--vp-c-text-1: #{mg.ref("color-ink")};
|
|
152
151
|
--vp-c-text-2: #{mg.ref("color-ink-muted")};
|
|
153
152
|
--vp-c-text-3: #{mg.ref("color-ink-faint")};
|
|
154
|
-
|
|
155
153
|
--vp-c-border: #{mg.ref("color-rule-strong")};
|
|
156
154
|
--vp-c-divider: #{mg.ref("color-rule")};
|
|
157
155
|
--vp-c-gutter: #{mg.ref("color-rule")};
|
|
158
|
-
|
|
159
156
|
--vp-c-brand-1: #{mg.ref("color-accent")};
|
|
160
157
|
--vp-c-brand-2: #{mg.ref("color-accent-hover")};
|
|
161
158
|
--vp-c-brand-3: #{mg.ref("color-accent")};
|
|
162
159
|
--vp-c-brand-soft: #{mg.ref("color-accent-soft")};
|
|
163
|
-
|
|
164
160
|
--vp-c-default-1: #{mg.ref("color-rule-strong")};
|
|
165
161
|
--vp-c-default-2: #{mg.ref("color-rule")};
|
|
166
162
|
--vp-c-default-3: #{mg.ref("color-surface-alt")};
|
|
167
163
|
--vp-c-default-soft: #{mg.ref("color-accent-soft")};
|
|
168
|
-
|
|
169
164
|
--vp-c-tip-1: #{mg.ref("color-accent")};
|
|
170
165
|
--vp-c-tip-soft: transparent;
|
|
171
166
|
--vp-c-note-1: #{mg.ref("color-accent")};
|
|
@@ -184,9 +179,9 @@ $dark: (
|
|
|
184
179
|
/* Elevation is a hairline job here — only overlays keep a shadow. */
|
|
185
180
|
--vp-shadow-1: none;
|
|
186
181
|
--vp-shadow-2: none;
|
|
187
|
-
--vp-shadow-3: 0 16px 40px rgb(0 0 0 /
|
|
188
|
-
--vp-shadow-4: 0 16px 40px rgb(0 0 0 /
|
|
189
|
-
--vp-shadow-5: 0 24px 64px rgb(0 0 0 / 12
|
|
182
|
+
--vp-shadow-3: 0 16px 40px rgb(0 0 0 / 0.08);
|
|
183
|
+
--vp-shadow-4: 0 16px 40px rgb(0 0 0 / 0.1);
|
|
184
|
+
--vp-shadow-5: 0 24px 64px rgb(0 0 0 / 0.12);
|
|
190
185
|
|
|
191
186
|
/**
|
|
192
187
|
* Distance from the edge of the viewport to the content band — the frame the whole theme is
|
|
@@ -194,7 +189,6 @@ $dark: (
|
|
|
194
189
|
* percentage resolves where the property is used.
|
|
195
190
|
*/
|
|
196
191
|
--ff-frame: max(4rem, calc((100% - #{mg.ref("layout-wide")}) / 2));
|
|
197
|
-
|
|
198
192
|
--vp-nav-height: 60px;
|
|
199
193
|
|
|
200
194
|
/**
|
|
@@ -206,7 +200,6 @@ $dark: (
|
|
|
206
200
|
--vp-layout-max-width: 76rem;
|
|
207
201
|
--vp-sidebar-width: 15rem;
|
|
208
202
|
--vp-header-anchor-symbol: "#";
|
|
209
|
-
|
|
210
203
|
--vp-code-font-size: 0.8125em;
|
|
211
204
|
--vp-code-color: #{mg.ref("color-ink")};
|
|
212
205
|
--vp-code-bg: #{mg.ref("color-surface-alt")};
|
|
@@ -218,7 +211,6 @@ $dark: (
|
|
|
218
211
|
--vp-code-copy-code-hover-bg: #{mg.ref("color-surface-alt")};
|
|
219
212
|
--vp-code-tab-divider: #{mg.ref("color-rule")};
|
|
220
213
|
--vp-code-tab-active-bar-color: #{mg.ref("color-accent")};
|
|
221
|
-
|
|
222
214
|
--vp-button-brand-border: #{mg.ref("color-accent")};
|
|
223
215
|
--vp-button-brand-text: #{mg.ref("color-accent-contrast")};
|
|
224
216
|
--vp-button-brand-bg: #{mg.ref("color-accent")};
|
|
@@ -226,7 +218,6 @@ $dark: (
|
|
|
226
218
|
--vp-button-brand-hover-text: #{mg.ref("color-accent-contrast")};
|
|
227
219
|
--vp-button-brand-hover-bg: #{mg.ref("color-accent-hover")};
|
|
228
220
|
--vp-button-brand-active-bg: #{mg.ref("color-accent-hover")};
|
|
229
|
-
|
|
230
221
|
--vp-button-alt-border: #{mg.ref("color-rule-strong")};
|
|
231
222
|
--vp-button-alt-text: #{mg.ref("color-ink")};
|
|
232
223
|
--vp-button-alt-bg: transparent;
|
|
@@ -234,9 +225,7 @@ $dark: (
|
|
|
234
225
|
--vp-button-alt-hover-text: #{mg.ref("color-ink")};
|
|
235
226
|
--vp-button-alt-hover-bg: transparent;
|
|
236
227
|
--vp-button-alt-active-bg: #{mg.ref("color-surface-alt")};
|
|
237
|
-
|
|
238
228
|
--vp-custom-block-font-size: 0.9375rem;
|
|
239
229
|
--vp-custom-block-code-font-size: 0.8125rem;
|
|
240
|
-
|
|
241
230
|
--vp-home-hero-name-color: #{mg.ref("color-ink")};
|
|
242
231
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultTheme } from 'vitepress/theme'
|
|
1
|
+
import type { DefaultTheme } from 'vitepress/theme';
|
|
2
2
|
|
|
3
3
|
export interface BannerConfig {
|
|
4
4
|
/** Stable id — changing it brings the banner back for readers who dismissed the previous one. */
|
|
@@ -137,4 +137,4 @@ export interface ThemeConfig extends DefaultTheme.Config {
|
|
|
137
137
|
ff?: ThemeOptions
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
export type { DefaultTheme }
|
|
140
|
+
export type { DefaultTheme };
|