@frontfactory/vitepress-theme 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,374 @@
1
+ // ============================================================================================= //
2
+ // THEME COMPONENTS //
3
+ // ============================================================================================= //
4
+
5
+ @use "theme" as mg;
6
+
7
+ // The dismissal class is set on <html>, outside the themed root. It carries the themed root in the
8
+ // selector so it outweighs the rule that lays the banner out, further down.
9
+
10
+ .ff-banner-dismissed .ff-theme .ff-banner {
11
+ display: none;
12
+ }
13
+
14
+ // The layout reserves room for whatever sits above the navigation through --vp-layout-top-height,
15
+ // and offsets the fixed bar and sidebar by it. Declaring the height here rather than waiting for
16
+ // the measurement in FfBanner.vue means the first paint is already correct.
17
+
18
+ :root:has(.ff-banner):not(.ff-banner-dismissed) {
19
+ --vp-layout-top-height: #{mg.ref("banner-height")};
20
+ }
21
+
22
+ .ff-theme {
23
+ // ----------------------------------------------------------------------------------------- //
24
+ // Announcement bar
25
+ // ----------------------------------------------------------------------------------------- //
26
+
27
+ // Fixed, like the bar it sits above: in the flow it would scroll away and leave the navigation
28
+ // stranded on an empty band.
29
+
30
+ .ff-banner {
31
+ position: fixed;
32
+ top: 0;
33
+ right: 0;
34
+ left: 0;
35
+ z-index: var(--vp-z-index-layout-top);
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ gap: 1rem;
40
+ min-height: #{mg.ref("banner-height")};
41
+ padding: 0.625rem 3rem;
42
+ background: #{mg.ref("color-ink")};
43
+ color: #{mg.ref("color-paper")};
44
+ }
45
+
46
+ .ff-banner-body {
47
+ display: flex;
48
+ align-items: center;
49
+ gap: 0.75rem;
50
+ font-size: 0.8125rem;
51
+ color: inherit;
52
+ }
53
+
54
+ .ff-banner-cta {
55
+ font-family: #{mg.ref("font-mono")};
56
+ font-size: #{mg.ref("size-label")};
57
+ text-transform: uppercase;
58
+ letter-spacing: #{mg.ref("tracking-label")};
59
+ text-decoration: underline;
60
+ text-underline-offset: 0.25em;
61
+ }
62
+
63
+ .ff-banner-close {
64
+ position: absolute;
65
+ top: 50%;
66
+ right: 1rem;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ width: 1.5rem;
71
+ height: 1.5rem;
72
+ border-radius: #{mg.ref("radius-sm")};
73
+ background: transparent;
74
+ font-size: 1.125rem;
75
+ line-height: 1;
76
+ color: inherit;
77
+ opacity: 0.6;
78
+ transform: translateY(-50%);
79
+ cursor: pointer;
80
+ }
81
+
82
+ .ff-banner-close:hover {
83
+ opacity: 1;
84
+ }
85
+
86
+ // ----------------------------------------------------------------------------------------- //
87
+ // Kicker printed above every page title
88
+ // ----------------------------------------------------------------------------------------- //
89
+
90
+ .ff-doc-meta {
91
+ flex-wrap: wrap;
92
+ gap: 0.75rem;
93
+ margin-bottom: 1.5rem;
94
+ padding-bottom: 1rem;
95
+ border-bottom: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
96
+ }
97
+
98
+ .ff-doc-meta-item + .ff-doc-meta-item::before {
99
+ content: "·";
100
+ margin-right: 0.75rem;
101
+ }
102
+
103
+ // ----------------------------------------------------------------------------------------- //
104
+ // Back to top
105
+ // ----------------------------------------------------------------------------------------- //
106
+
107
+ .ff-to-top {
108
+ position: fixed;
109
+ right: 1.5rem;
110
+ bottom: 1.5rem;
111
+ z-index: 20;
112
+ gap: 0.375rem;
113
+ padding: 0.625rem 0.75rem;
114
+ border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
115
+ border-radius: #{mg.ref("radius-sm")};
116
+ background: #{mg.ref("color-surface")};
117
+ cursor: pointer;
118
+ opacity: 0;
119
+ transform: translateY(0.5rem);
120
+ pointer-events: none;
121
+ transition:
122
+ opacity #{mg.ref("motion-duration")} #{mg.ref("motion-ease")},
123
+ transform #{mg.ref("motion-duration")} #{mg.ref("motion-ease")},
124
+ border-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
125
+ }
126
+
127
+ .ff-to-top.is-visible {
128
+ opacity: 1;
129
+ transform: translateY(0);
130
+ pointer-events: auto;
131
+ }
132
+
133
+ // ----------------------------------------------------------------------------------------- //
134
+ // Footer
135
+ // ----------------------------------------------------------------------------------------- //
136
+
137
+ .ff-footer {
138
+ position: relative;
139
+ z-index: var(--vp-z-index-footer);
140
+ padding: 3.5rem 1.5rem 2.5rem;
141
+ border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
142
+ background: #{mg.ref("color-paper")};
143
+ }
144
+
145
+ .ff-footer.has-sidebar {
146
+ display: none;
147
+ }
148
+
149
+ .ff-footer-container {
150
+ max-width: #{mg.ref("layout-wide")};
151
+ margin: 0 auto;
152
+ }
153
+
154
+ .ff-footer-columns {
155
+ display: grid;
156
+ grid-template-columns: repeat(auto-fill, minmax(9rem, 12rem));
157
+ gap: 2rem;
158
+ }
159
+
160
+ .ff-footer-column ul {
161
+ margin: 1rem 0 0;
162
+ padding: 0;
163
+ list-style: none;
164
+ }
165
+
166
+ .ff-footer-column li + li {
167
+ margin-top: 0.5rem;
168
+ }
169
+
170
+ .ff-footer-column a {
171
+ font-size: 0.875rem;
172
+ color: #{mg.ref("color-ink-muted")};
173
+ transition: color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
174
+ }
175
+
176
+ .ff-footer-column a:hover {
177
+ color: #{mg.ref("color-ink")};
178
+ }
179
+
180
+ .ff-footer-legal {
181
+ display: flex;
182
+ flex-wrap: wrap;
183
+ justify-content: space-between;
184
+ gap: 0.5rem 2rem;
185
+ margin-top: 3rem;
186
+ padding-top: 1.5rem;
187
+ border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
188
+ font-family: #{mg.ref("font-mono")};
189
+ font-size: #{mg.ref("size-meta")};
190
+ color: #{mg.ref("color-ink-faint")};
191
+ }
192
+
193
+ .ff-footer-legal p {
194
+ margin: 0;
195
+ }
196
+
197
+ @media (min-width: 768px) {
198
+ .ff-footer {
199
+ padding: 4rem 3rem 2.5rem;
200
+ }
201
+ }
202
+
203
+ // ----------------------------------------------------------------------------------------- //
204
+ // Cards
205
+ // ----------------------------------------------------------------------------------------- //
206
+
207
+ .vp-doc .ff-card-grid {
208
+ display: grid;
209
+ grid-template-columns: repeat(var(--ff-card-columns, 2), minmax(0, 1fr));
210
+ gap: 1rem;
211
+ margin: 1.75rem 0;
212
+ }
213
+
214
+ .vp-doc .ff-card {
215
+ display: block;
216
+ padding: 1.25rem;
217
+ border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
218
+ border-radius: #{mg.ref("radius-md")};
219
+ background: #{mg.ref("color-surface")};
220
+ transition: border-color #{mg.ref("motion-duration")} #{mg.ref("motion-ease")};
221
+ }
222
+
223
+ .vp-doc a.ff-card {
224
+ text-decoration: none;
225
+ }
226
+
227
+ .vp-doc a.ff-card:hover {
228
+ border-color: #{mg.ref("color-accent")};
229
+ }
230
+
231
+ .vp-doc .ff-card-icon {
232
+ display: block;
233
+ margin-bottom: 0.75rem;
234
+ font-size: 1.25rem;
235
+ line-height: 1;
236
+ color: #{mg.ref("color-accent")};
237
+ }
238
+
239
+ .vp-doc .ff-card-title {
240
+ margin: 0;
241
+ font-family: #{mg.ref("font-display")};
242
+ font-size: 1rem;
243
+ font-weight: 620;
244
+ letter-spacing: -0.01em;
245
+ color: #{mg.ref("color-ink")};
246
+ }
247
+
248
+ .vp-doc .ff-card-body,
249
+ .vp-doc .ff-card-body p {
250
+ margin: 0.5rem 0 0;
251
+ font-size: 0.9375rem;
252
+ line-height: 1.6;
253
+ color: #{mg.ref("color-ink-muted")};
254
+ }
255
+
256
+ @media (max-width: 640px) {
257
+ .vp-doc .ff-card-grid {
258
+ grid-template-columns: minmax(0, 1fr);
259
+ }
260
+ }
261
+
262
+ // ----------------------------------------------------------------------------------------- //
263
+ // Steps
264
+ // ----------------------------------------------------------------------------------------- //
265
+
266
+ .vp-doc .ff-steps ol {
267
+ margin: 1.75rem 0;
268
+ padding-left: 2.5rem;
269
+ border-left: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
270
+ list-style: none;
271
+ counter-reset: ff-step;
272
+ }
273
+
274
+ .vp-doc .ff-steps ol > li {
275
+ position: relative;
276
+ margin: 0;
277
+ padding-bottom: 1.5rem;
278
+ counter-increment: ff-step;
279
+ }
280
+
281
+ .vp-doc .ff-steps ol > li:last-child {
282
+ padding-bottom: 0;
283
+ }
284
+
285
+ .vp-doc .ff-steps ol > li::before {
286
+ content: counter(ff-step, decimal-leading-zero);
287
+ position: absolute;
288
+ top: 0.25rem;
289
+ left: -3.25rem;
290
+ width: 1.5rem;
291
+ padding: 0.125rem 0;
292
+ background: #{mg.ref("color-paper")};
293
+ font-family: #{mg.ref("font-mono")};
294
+ font-size: #{mg.ref("size-label")};
295
+ font-weight: 500;
296
+ text-align: center;
297
+ color: #{mg.ref("color-accent")};
298
+ }
299
+
300
+ // ----------------------------------------------------------------------------------------- //
301
+ // API entries
302
+ // ----------------------------------------------------------------------------------------- //
303
+
304
+ .vp-doc .ff-api {
305
+ margin: 2.5rem 0;
306
+ padding-top: 1.25rem;
307
+ border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
308
+ }
309
+
310
+ .vp-doc .ff-api-head {
311
+ display: flex;
312
+ flex-wrap: wrap;
313
+ align-items: baseline;
314
+ gap: 0.75rem;
315
+ }
316
+
317
+ .vp-doc .ff-api-name,
318
+ .vp-doc .ff-api-signature code {
319
+ padding: 0;
320
+ border-radius: 0;
321
+ background: transparent;
322
+ font-family: #{mg.ref("font-mono")};
323
+ }
324
+
325
+ .vp-doc .ff-api-name {
326
+ font-size: 1.0625rem;
327
+ font-weight: 600;
328
+ color: #{mg.ref("color-ink")};
329
+ }
330
+
331
+ .vp-doc .ff-api.is-deprecated .ff-api-name {
332
+ text-decoration: line-through;
333
+ color: #{mg.ref("color-ink-faint")};
334
+ }
335
+
336
+ .vp-doc .ff-api-kind {
337
+ color: #{mg.ref("color-accent")};
338
+ }
339
+
340
+ .vp-doc .ff-api-deprecated {
341
+ color: #{mg.ref("color-danger")};
342
+ }
343
+
344
+ .vp-doc .ff-api-signature {
345
+ margin: 0.625rem 0 0;
346
+ }
347
+
348
+ .vp-doc .ff-api-signature code {
349
+ font-size: 0.8125rem;
350
+ color: #{mg.ref("color-ink-muted")};
351
+ }
352
+
353
+ .vp-doc .ff-api-body > :first-child {
354
+ margin-top: 0.75rem;
355
+ }
356
+
357
+ // ----------------------------------------------------------------------------------------- //
358
+ // Keys
359
+ // ----------------------------------------------------------------------------------------- //
360
+
361
+ .vp-doc .ff-kbd {
362
+ display: inline-block;
363
+ min-width: 1.5rem;
364
+ padding: 0.0625rem 0.375rem;
365
+ border: #{mg.ref("rule-width")} solid #{mg.ref("color-rule-strong")};
366
+ border-radius: #{mg.ref("radius-sm")};
367
+ background: #{mg.ref("color-surface")};
368
+ font-family: #{mg.ref("font-mono")};
369
+ font-size: 0.75rem;
370
+ line-height: 1.4;
371
+ text-align: center;
372
+ color: #{mg.ref("color-ink-muted")};
373
+ }
374
+ }