@frontfactory/vitepress-theme 1.0.0 → 1.1.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/README.md CHANGED
@@ -81,6 +81,7 @@ follows.
81
81
  | `--ff-layout-wide` | Home and container width |
82
82
  | `--ff-radius-sm` / `-md` | Corner radii |
83
83
  | `--ff-rule-width` / `--ff-rule-accent-width` | Rule weights |
84
+ | `--ff-hero-glow-opacity` | Hero light washes, `0` (off) by default |
84
85
 
85
86
  `dist/style.css` lists them all, grouped, at the top of the file.
86
87
 
@@ -171,6 +172,18 @@ formatted with `Intl.RelativeTimeFormat` in the page's own `lang`.
171
172
  Standard VitePress home frontmatter, read with an editorial hierarchy: `hero.name` becomes the
172
173
  kicker, `hero.text` the headline. Two additions fill the page out.
173
174
 
175
+ The hero can also carry two soft washes of light, one accent and one neutral, behind the headline.
176
+ They are off by default — a site turns them on by raising `--ff-hero-glow-opacity`, which drives
177
+ both at once and takes any value between `0` and `1`:
178
+
179
+ ```css
180
+ :root {
181
+ --ff-hero-glow-opacity: 1;
182
+ }
183
+ ```
184
+
185
+ Their colours come from `--ff-color-accent-glow` and `--ff-color-accent-soft`, per scheme.
186
+
174
187
  `hero.command` puts an install panel in the second column of the hero, carrying the command and the
175
188
  actions. It is used only when the page has no `hero.image` and nothing filled the `home-hero-image`
176
189
  slot — an image still takes that column. `hero.meta` prints a colophon strip under the hero. Both
package/dist/style.css CHANGED
@@ -15,7 +15,7 @@
15
15
  --ff-size-h1: clamp(1.625rem, 1.3rem + 1.3vw, 2rem);
16
16
  --ff-size-h2: 1.5rem;
17
17
  --ff-size-h3: 1.1875rem;
18
- --ff-size-hero: clamp(1.75rem, 1.125rem + 2.5vw, 3rem);
18
+ --ff-size-hero: clamp(1.5rem, 1.05rem + 1.8vw, 2.375rem);
19
19
  --ff-leading-body: 1.75;
20
20
  --ff-leading-tight: 1.15;
21
21
  --ff-radius-sm: 5px;
@@ -26,6 +26,7 @@
26
26
  --ff-motion-duration-slow: 420ms;
27
27
  --ff-motion-ease: cubic-bezier(0.2, 0.6, 0.2, 1);
28
28
  --ff-banner-height: 2.6875rem;
29
+ --ff-hero-glow-opacity: 0;
29
30
  --ff-layout-content: 44rem;
30
31
  --ff-layout-wide: 76rem;
31
32
  --ff-color-paper: #fbfaf8;
@@ -999,6 +1000,7 @@
999
1000
  width: min(72rem, 150%);
1000
1001
  aspect-ratio: 1;
1001
1002
  background: radial-gradient(circle closest-side at 45% 45%, var(--ff-color-accent-glow), transparent);
1003
+ opacity: var(--ff-hero-glow-opacity);
1002
1004
  pointer-events: none;
1003
1005
  }
1004
1006
  .ff-theme .ff-hero-glow-far {
@@ -1019,19 +1021,14 @@
1019
1021
  margin: 0 0 1.5rem;
1020
1022
  color: var(--ff-color-ink-muted);
1021
1023
  }
1022
- .ff-theme .ff-hero-mark {
1023
- width: 0.5rem;
1024
- height: 0.5rem;
1025
- border-radius: 2px;
1026
- background: var(--ff-color-accent);
1027
- }
1028
1024
  .ff-theme .ff-hero-title {
1029
1025
  max-width: 20ch;
1030
1026
  margin: 0;
1031
1027
  font-family: var(--ff-font-title);
1032
1028
  font-size: var(--ff-size-hero);
1033
1029
  font-weight: 600;
1034
- letter-spacing: 0.01em;
1030
+ letter-spacing: 0;
1031
+ word-spacing: -0.3em;
1035
1032
  text-transform: uppercase;
1036
1033
  color: var(--ff-color-ink);
1037
1034
  text-wrap: balance;
@@ -1585,23 +1582,10 @@
1585
1582
  transform: translate3d(6%, 4%, 0) scale(1.12);
1586
1583
  }
1587
1584
  }
1588
- @keyframes ff-beacon {
1589
- 0%, 100% {
1590
- opacity: 1;
1591
- box-shadow: 0 0 0 0 var(--ff-color-accent-glow);
1592
- }
1593
- 50% {
1594
- opacity: 0.72;
1595
- box-shadow: 0 0 0 0.375rem transparent;
1596
- }
1597
- }
1598
1585
  @media (prefers-reduced-motion: no-preference) {
1599
1586
  .ff-theme .ff-hero-glow {
1600
1587
  animation: ff-drift 26s var(--ff-motion-ease) infinite alternate;
1601
1588
  }
1602
- .ff-theme .ff-hero-mark {
1603
- animation: ff-beacon 3.2s ease-in-out infinite;
1604
- }
1605
1589
  .ff-theme .ff-hero-kicker,
1606
1590
  .ff-theme .ff-hero-title,
1607
1591
  .ff-theme .ff-hero-tagline,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontfactory/vitepress-theme",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Editorial VitePress theme — hairline rules, numbered sections and monospaced metadata.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -87,10 +87,7 @@ async function copy() {
87
87
  <slot name="home-hero-info-before" />
88
88
 
89
89
  <slot name="home-hero-info">
90
- <p v-if="name" class="ff-hero-kicker ff-label">
91
- <span class="ff-hero-mark" aria-hidden="true" />
92
- <span v-html="name" />
93
- </p>
90
+ <p v-if="name" class="ff-hero-kicker ff-label" v-html="name" />
94
91
 
95
92
  <h1 v-if="text" class="ff-hero-title ff-display" v-html="text" />
96
93
 
@@ -37,7 +37,8 @@
37
37
  border-bottom-color: transparent;
38
38
  }
39
39
 
40
- // Two washes of light, one accent and one neutral, so the page has a direction.
40
+ // Two washes of light, one accent and one neutral, so the page has a direction. Off unless the
41
+ // site asks for them: --ff-hero-glow-opacity carries the whole effect, both washes at once.
41
42
 
42
43
  .ff-hero-glow {
43
44
  position: absolute;
@@ -54,6 +55,7 @@
54
55
  #{mg.ref("color-accent-glow")},
55
56
  transparent
56
57
  );
58
+ opacity: #{mg.ref("hero-glow-opacity")};
57
59
  pointer-events: none;
58
60
  }
59
61
 
@@ -82,13 +84,6 @@
82
84
  color: #{mg.ref("color-ink-muted")};
83
85
  }
84
86
 
85
- .ff-hero-mark {
86
- width: 0.5rem;
87
- height: 0.5rem;
88
- border-radius: 2px;
89
- background: #{mg.ref("color-accent")};
90
- }
91
-
92
87
  // The headline is the one place the theme changes voice: the mono it uses everywhere else for
93
88
  // machine text, here at display size. max-width is in ch, so against a monospaced face it is
94
89
  // an exact character count — the headline breaks on a measure, not on a guess.
@@ -100,9 +95,11 @@
100
95
  font-size: #{mg.ref("size-hero")};
101
96
  font-weight: 600;
102
97
  // Capitals on a monospaced face put every glyph on the same square cell — the blockiest
103
- // the headline can get without shipping a webfont. Uppercase needs the tracking back:
104
- // the negative fit that suits lowercase closes capitals up.
105
- letter-spacing: 0.01em;
98
+ // the headline can get without shipping a webfont. A monospaced face already sets its own
99
+ // cell width, so at this size the capitals need no tracking added on top. The word gap is
100
+ // one of those full cells, which reads as a hole at display size: pull it back a third.
101
+ letter-spacing: 0;
102
+ word-spacing: -0.3em;
106
103
  text-transform: uppercase;
107
104
  color: #{mg.ref("color-ink")};
108
105
  text-wrap: balance;
@@ -30,19 +30,6 @@
30
30
  }
31
31
  }
32
32
 
33
- @keyframes ff-beacon {
34
- 0%,
35
- 100% {
36
- opacity: 1;
37
- box-shadow: 0 0 0 0 #{mg.ref("color-accent-glow")};
38
- }
39
-
40
- 50% {
41
- opacity: 0.72;
42
- box-shadow: 0 0 0 0.375rem transparent;
43
- }
44
- }
45
-
46
33
  @media (prefers-reduced-motion: no-preference) {
47
34
  .ff-theme {
48
35
  // ------------------------------------------------------------------------------------- //
@@ -53,10 +40,6 @@
53
40
  animation: ff-drift 26s #{mg.ref("motion-ease")} infinite alternate;
54
41
  }
55
42
 
56
- .ff-hero-mark {
57
- animation: ff-beacon 3.2s ease-in-out infinite;
58
- }
59
-
60
43
  .ff-hero-kicker,
61
44
  .ff-hero-title,
62
45
  .ff-hero-tagline,
@@ -34,7 +34,7 @@ $scales: (
34
34
  "h1": clamp(1.625rem, 1.3rem + 1.3vw, 2rem),
35
35
  "h2": 1.5rem,
36
36
  "h3": 1.1875rem,
37
- "hero": clamp(1.75rem, 1.125rem + 2.5vw, 3rem)
37
+ "hero": clamp(1.5rem, 1.05rem + 1.8vw, 2.375rem)
38
38
  ),
39
39
  "leading": (
40
40
  "body": 1.75,
@@ -56,6 +56,13 @@ $scales: (
56
56
  "banner": (
57
57
  "height": 2.6875rem
58
58
  ),
59
+
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
+ "hero": (
64
+ "glow-opacity": 0
65
+ ),
59
66
  "layout": (
60
67
  "content": 44rem,
61
68
  "wide": 76rem