@frontfactory/vitepress-theme 1.4.2 → 1.5.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/config.js CHANGED
@@ -11,7 +11,8 @@ const pkg = '@frontfactory/vitepress-theme'
11
11
  const overrides = {
12
12
  VPHero: 'src/components/FfHero.vue',
13
13
  VPFeature: 'src/components/FfFeature.vue',
14
- VPFooter: 'src/components/FfFooter.vue'
14
+ VPFooter: 'src/components/FfFooter.vue',
15
+ VPHomeSponsors: 'src/components/FfHomeSponsors.vue'
15
16
  }
16
17
 
17
18
  const alias = Object.entries(overrides).map(([name, file]) => ({
package/dist/style.css CHANGED
@@ -1326,23 +1326,30 @@
1326
1326
  border-radius: var(--ff-radius-sm);
1327
1327
  font-size: 0.875rem;
1328
1328
  font-weight: 550;
1329
+ text-decoration: none;
1329
1330
  white-space: nowrap;
1330
1331
  }
1331
- .ff-theme .ff-btn-brand {
1332
+ .ff-theme .vp-doc .ff-btn {
1333
+ font-weight: 550;
1334
+ text-decoration: none;
1335
+ }
1336
+ .ff-theme .ff-btn.ff-btn-brand {
1332
1337
  border-color: var(--ff-color-accent);
1333
1338
  background: var(--ff-color-accent);
1334
1339
  color: var(--ff-color-accent-contrast);
1335
1340
  }
1336
- .ff-theme .ff-btn-brand:hover {
1341
+ .ff-theme .ff-btn.ff-btn-brand:hover {
1337
1342
  border-color: var(--ff-color-accent-hover);
1338
1343
  background: var(--ff-color-accent-hover);
1344
+ color: var(--ff-color-accent-contrast);
1339
1345
  }
1340
- .ff-theme .ff-btn-alt {
1346
+ .ff-theme .ff-btn.ff-btn-alt {
1341
1347
  border-color: var(--ff-color-rule-strong);
1342
1348
  color: var(--ff-color-ink);
1343
1349
  }
1344
- .ff-theme .ff-btn-alt:hover {
1350
+ .ff-theme .ff-btn.ff-btn-alt:hover {
1345
1351
  border-color: var(--ff-color-ink);
1352
+ color: var(--ff-color-ink);
1346
1353
  }
1347
1354
  .ff-theme .VPFeatures {
1348
1355
  padding: 2.5rem 1.5rem 3rem;
@@ -1446,6 +1453,91 @@
1446
1453
  grid-template-columns: repeat(4, minmax(0, 1fr));
1447
1454
  }
1448
1455
  }
1456
+ .ff-theme .ff-sponsors {
1457
+ padding: 2.5rem 1.5rem 3rem;
1458
+ border-top: var(--ff-rule-width) solid var(--ff-color-rule);
1459
+ }
1460
+ .ff-theme .vp-doc .VPHomeSponsors.ff-sponsors {
1461
+ margin-left: -1.5rem;
1462
+ margin-right: -1.5rem;
1463
+ }
1464
+ .ff-theme .ff-sponsors-container {
1465
+ max-width: var(--ff-layout-wide);
1466
+ margin: 0 auto;
1467
+ text-align: center;
1468
+ }
1469
+ .ff-theme .vp-doc .ff-sponsors-title {
1470
+ margin: 0;
1471
+ border-top: 0;
1472
+ padding-top: 0;
1473
+ font-family: var(--ff-font-title);
1474
+ font-size: var(--ff-size-h1);
1475
+ font-weight: 600;
1476
+ letter-spacing: 0;
1477
+ word-spacing: -0.3em;
1478
+ text-transform: uppercase;
1479
+ color: var(--ff-color-ink);
1480
+ font-variation-settings: normal;
1481
+ }
1482
+ .ff-theme .ff-sponsors-message {
1483
+ max-width: 42ch;
1484
+ margin: 0.75rem auto 0;
1485
+ font-size: var(--ff-size-body);
1486
+ line-height: 1.55;
1487
+ color: var(--ff-color-ink-muted);
1488
+ }
1489
+ .ff-theme .ff-sponsors-grid {
1490
+ margin-top: 2rem;
1491
+ }
1492
+ .ff-theme .ff-sponsors-grid.vp-sponsor {
1493
+ border-radius: var(--ff-radius-md);
1494
+ }
1495
+ .ff-theme .ff-sponsors-grid .vp-sponsor-grid {
1496
+ justify-content: center;
1497
+ }
1498
+ .ff-theme .ff-sponsors-grid .vp-sponsor-grid-link {
1499
+ min-height: 90px;
1500
+ }
1501
+ .ff-theme .ff-sponsors-grid .vp-sponsor-grid-image {
1502
+ max-width: 120px;
1503
+ max-height: 32px;
1504
+ }
1505
+ .ff-theme .ff-sponsors-grid .vp-sponsor-tier {
1506
+ display: flex;
1507
+ align-items: center;
1508
+ justify-content: flex-start;
1509
+ height: 60px;
1510
+ margin: 0 0 0.25rem;
1511
+ padding: 0 1.25rem;
1512
+ font-family: var(--ff-font-mono);
1513
+ font-size: 14px;
1514
+ font-weight: 500;
1515
+ letter-spacing: var(--ff-tracking-label);
1516
+ text-align: left;
1517
+ text-transform: uppercase;
1518
+ color: var(--ff-color-ink-faint);
1519
+ }
1520
+ .ff-theme .ff-sponsors-action {
1521
+ margin-top: 2rem;
1522
+ }
1523
+ @media (min-width: 640px) {
1524
+ .ff-theme .ff-sponsors {
1525
+ padding: 3rem 3rem 3.5rem;
1526
+ }
1527
+ .ff-theme .vp-doc .VPHomeSponsors.ff-sponsors {
1528
+ margin-left: -3rem;
1529
+ margin-right: -3rem;
1530
+ }
1531
+ }
1532
+ @media (min-width: 960px) {
1533
+ .ff-theme .ff-sponsors {
1534
+ padding: 3.5rem 4rem 4rem;
1535
+ }
1536
+ .ff-theme .vp-doc .VPHomeSponsors.ff-sponsors {
1537
+ margin-left: -4rem;
1538
+ margin-right: -4rem;
1539
+ }
1540
+ }
1449
1541
 
1450
1542
  .ff-banner-dismissed .ff-theme .ff-banner {
1451
1543
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontfactory/vitepress-theme",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "Editorial VitePress theme — hairline rules, numbered sections and monospaced metadata.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "release": "semantic-release"
15
15
  },
16
16
  "engines": {
17
- "node": ">=20"
17
+ "node": ">=24"
18
18
  },
19
19
  "main": "./src/index.ts",
20
20
  "module": "./src/index.ts",
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ import { VPSponsors } from '../internal'
3
+ import { useLabels } from '../composables/options'
4
+
5
+ export interface SponsorItem {
6
+ name: string
7
+ img: string
8
+ url: string
9
+ }
10
+
11
+ export interface SponsorTier {
12
+ tier?: string
13
+ size?: 'xmini' | 'mini' | 'small' | 'medium' | 'big'
14
+ items: SponsorItem[]
15
+ }
16
+
17
+ defineProps<{
18
+ message?: string
19
+ actionText?: string
20
+ actionLink?: string
21
+ data: SponsorTier[] | SponsorItem[]
22
+ }>()
23
+
24
+ const labels = useLabels()
25
+ </script>
26
+
27
+ <template>
28
+ <section class="VPHomeSponsors ff-sponsors">
29
+ <div class="ff-sponsors-container">
30
+ <h2 class="ff-sponsors-title ff-display">{{ labels.sponsors }}</h2>
31
+ <p v-if="message" class="ff-sponsors-message">{{ message }}</p>
32
+
33
+ <VPSponsors class="ff-sponsors-grid" :data="data" />
34
+
35
+ <div v-if="actionLink" class="ff-sponsors-action">
36
+ <a class="ff-btn ff-btn-alt no-icon" :href="actionLink">{{ actionText ?? labels.sponsorsAction }}</a>
37
+ </div>
38
+ </div>
39
+ </section>
40
+ </template>
@@ -22,7 +22,9 @@ export const defaultLabels: Required<ThemeLabels> = {
22
22
  heroCopied: 'Copied',
23
23
  heroCopyLabel: 'Copy {0}',
24
24
  backToTop: 'Top',
25
- footerSocial: 'Follow'
25
+ footerSocial: 'Follow',
26
+ sponsors: 'Sponsors',
27
+ sponsorsAction: 'Become a sponsor'
26
28
  }
27
29
 
28
30
  /**
package/src/internal.ts CHANGED
@@ -8,4 +8,5 @@
8
8
  export { default as VPIcon } from 'vitepress/dist/client/theme-default/components/VPIcon.vue'
9
9
  export { default as VPImage } from 'vitepress/dist/client/theme-default/components/VPImage.vue'
10
10
  export { default as VPLink } from 'vitepress/dist/client/theme-default/components/VPLink.vue'
11
+ export { default as VPSponsors } from 'vitepress/dist/client/theme-default/components/VPSponsors.vue'
11
12
  export { useLayout } from 'vitepress/dist/client/theme-default/composables/layout.js'
@@ -438,27 +438,41 @@
438
438
  border-radius: #{mg.ref("radius-sm")};
439
439
  font-size: 0.875rem;
440
440
  font-weight: 550;
441
+ text-decoration: none;
441
442
  white-space: nowrap;
442
443
  }
443
444
 
444
- .ff-btn-brand {
445
+ // The sponsors button is the one `.ff-btn` that lands inside `.vp-doc` — `.ff-theme .vp-doc a`
446
+ // (see _doc.scss) sets prose-link weight and colour there, at a higher specificity than a bare
447
+ // `.ff-btn`/`.ff-btn-brand` class reaches on its own (an extra `a` in its selector). Scoping
448
+ // this rule to `.vp-doc` and compounding the modifiers onto `.ff-btn` below both add the class
449
+ // this needs to outrank it.
450
+
451
+ .vp-doc .ff-btn {
452
+ font-weight: 550;
453
+ text-decoration: none;
454
+ }
455
+
456
+ .ff-btn.ff-btn-brand {
445
457
  border-color: #{mg.ref("color-accent")};
446
458
  background: #{mg.ref("color-accent")};
447
459
  color: #{mg.ref("color-accent-contrast")};
448
460
  }
449
461
 
450
- .ff-btn-brand:hover {
462
+ .ff-btn.ff-btn-brand:hover {
451
463
  border-color: #{mg.ref("color-accent-hover")};
452
464
  background: #{mg.ref("color-accent-hover")};
465
+ color: #{mg.ref("color-accent-contrast")};
453
466
  }
454
467
 
455
- .ff-btn-alt {
468
+ .ff-btn.ff-btn-alt {
456
469
  border-color: #{mg.ref("color-rule-strong")};
457
470
  color: #{mg.ref("color-ink")};
458
471
  }
459
472
 
460
- .ff-btn-alt:hover {
473
+ .ff-btn.ff-btn-alt:hover {
461
474
  border-color: #{mg.ref("color-ink")};
475
+ color: #{mg.ref("color-ink")};
462
476
  }
463
477
 
464
478
  // ----------------------------------------------------------------------------------------- //
@@ -596,4 +610,141 @@
596
610
  grid-template-columns: repeat(4, minmax(0, 1fr));
597
611
  }
598
612
  }
613
+
614
+ // ----------------------------------------------------------------------------------------- //
615
+ // Sponsors
616
+ //
617
+ // A closing section under the features: a title, an optional line of thanks, then the grid
618
+ // itself — the default theme's own components (see FfHomeSponsors), restyled onto the theme's
619
+ // own radius and heading tokens rather than the default's pill tier and 1rem-rounded card.
620
+ // Centred throughout, including the grid — flex-wrap content ignores the container's own
621
+ // text-align, so it needs its own justify-content to actually sit in the middle.
622
+ // ----------------------------------------------------------------------------------------- //
623
+
624
+ .ff-sponsors {
625
+ // Matches `.VPFeatures`'s own padding exactly, top/bottom included, so the two sections
626
+ // read as one continuous rhythm rather than the sponsors block sitting noticeably taller.
627
+ padding: 2.5rem 1.5rem 3rem;
628
+ border-top: #{mg.ref("rule-width")} solid #{mg.ref("color-rule")};
629
+ }
630
+
631
+ // The default theme bleeds `.VPHomeSponsors` to the full *viewport* width inside `.vp-doc` (see
632
+ // VPHomeContent.vue) via `calc(50% - 50vw)` — `vw` counts the scrollbar, `.VPFeatures` doesn't,
633
+ // so the two sections' edges landed a scrollbar's-width apart. Replaced with a
634
+ // bleed sized to `.vp-doc .container`'s own padding instead (same breakpoints, matched below):
635
+ // exactly cancels that padding rather than approximating the viewport, so this section's edges
636
+ // land exactly on `.VPFeatures`'s, which carries no such container to escape in the first place.
637
+
638
+ .vp-doc .VPHomeSponsors.ff-sponsors {
639
+ margin-left: -1.5rem;
640
+ margin-right: -1.5rem;
641
+ }
642
+
643
+ .ff-sponsors-container {
644
+ max-width: #{mg.ref("layout-wide")};
645
+ margin: 0 auto;
646
+ text-align: center;
647
+ }
648
+
649
+ // Borrows the hero headline's voice — mono, uppercase, tight word-spacing — rather than the
650
+ // doc prose treatment `.vp-doc h2` (see _doc.scss) would otherwise give it. Scoped through
651
+ // `.vp-doc` (not just `.ff-sponsors-title` alone): `.ff-theme .vp-doc h2` carries an extra `h2`
652
+ // in its selector, which outranks a single bare class on specificity.
653
+
654
+ .vp-doc .ff-sponsors-title {
655
+ margin: 0;
656
+ border-top: 0;
657
+ padding-top: 0;
658
+ font-family: #{mg.ref("font-title")};
659
+ font-size: #{mg.ref("size-h1")};
660
+ font-weight: 600;
661
+ letter-spacing: 0;
662
+ word-spacing: -0.3em;
663
+ text-transform: uppercase;
664
+ color: #{mg.ref("color-ink")};
665
+
666
+ // Drops the optical-size axis .ff-display sets for Inter — same reasoning as the hero title.
667
+ font-variation-settings: normal;
668
+ }
669
+
670
+ .ff-sponsors-message {
671
+ // Matches `.ff-hero-tagline`'s measure — 32ch was breaking this sentence into an unbalanced
672
+ // two-line stub.
673
+ max-width: 42ch;
674
+ margin: 0.75rem auto 0;
675
+ font-size: #{mg.ref("size-body")};
676
+ line-height: 1.55;
677
+ color: #{mg.ref("color-ink-muted")};
678
+ }
679
+
680
+ .ff-sponsors-grid {
681
+ margin-top: 2rem;
682
+ }
683
+
684
+ .ff-sponsors-grid.vp-sponsor {
685
+ border-radius: #{mg.ref("radius-md")};
686
+ }
687
+
688
+ .ff-sponsors-grid .vp-sponsor-grid {
689
+ justify-content: center;
690
+ }
691
+
692
+ // The default theme's size presets (`.medium`, `.big`, …) grow the tile far faster than the
693
+ // logo inside it — `.big` triples the tile's height for one extra rem of logo — leaving mostly
694
+ // dead padding. Fixed values here instead, sized so the mark actually fills its tile.
695
+
696
+ .ff-sponsors-grid .vp-sponsor-grid-link {
697
+ min-height: 90px;
698
+ }
699
+
700
+ .ff-sponsors-grid .vp-sponsor-grid-image {
701
+ max-width: 120px;
702
+ max-height: 32px;
703
+ }
704
+
705
+ // Same background band as the default (`--vp-c-bg-soft`, already remapped to the theme's own
706
+ // surface token), left-aligned and fixed-height instead of the default's centred auto-height
707
+ // pill, with the theme's own label typography (mono, uppercase, tracked).
708
+
709
+ .ff-sponsors-grid .vp-sponsor-tier {
710
+ display: flex;
711
+ align-items: center;
712
+ justify-content: flex-start;
713
+ height: 60px;
714
+ margin: 0 0 0.25rem;
715
+ padding: 0 1.25rem;
716
+ font-family: #{mg.ref("font-mono")};
717
+ font-size: 14px;
718
+ font-weight: 500;
719
+ letter-spacing: #{mg.ref("tracking-label")};
720
+ text-align: left;
721
+ text-transform: uppercase;
722
+ color: #{mg.ref("color-ink-faint")};
723
+ }
724
+
725
+ .ff-sponsors-action {
726
+ margin-top: 2rem;
727
+ }
728
+
729
+ @media (min-width: 640px) {
730
+ .ff-sponsors {
731
+ padding: 3rem 3rem 3.5rem;
732
+ }
733
+
734
+ .vp-doc .VPHomeSponsors.ff-sponsors {
735
+ margin-left: -3rem;
736
+ margin-right: -3rem;
737
+ }
738
+ }
739
+
740
+ @media (min-width: 960px) {
741
+ .ff-sponsors {
742
+ padding: 3.5rem 4rem 4rem;
743
+ }
744
+
745
+ .vp-doc .VPHomeSponsors.ff-sponsors {
746
+ margin-left: -4rem;
747
+ margin-right: -4rem;
748
+ }
749
+ }
599
750
  }
package/src/types.ts CHANGED
@@ -68,6 +68,10 @@ export interface ThemeLabels {
68
68
  backToTop?: string
69
69
  /** Heading of the footer social column. Defaults to `Follow`. */
70
70
  footerSocial?: string
71
+ /** Heading of the sponsors section. Defaults to `Sponsors`. */
72
+ sponsors?: string
73
+ /** Sponsors section action button, when the site sets `actionLink` but no `actionText`. Defaults to `Become a sponsor`. */
74
+ sponsorsAction?: string
71
75
  }
72
76
 
73
77
  /** One entry of the colophon strip printed under the hero. */