Skip to content

Commit 45eac14

Browse files
Aitthiclaude
andcommitted
docs(site): keep home navbar dark-glass on scroll (was white-on-white)
VitePress paints `.VPNavBar.fill` with the opaque light --vp-nav-bg-color once scrolled; the home pill's light text then became white-on-white. Pin a dark translucent glass in both states (slightly more opaque when filled), beating .fill's specificity with !important. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6ca7006 commit 45eac14

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

docs/site/.vitepress/theme/custom.css

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,33 @@ html.grainient-on .VPContent {
3636

3737
/* ── Home: floating glass "pill" navbar over the grainient ──────────── */
3838
html.grainient-on .VPNav {
39-
background-color: transparent;
40-
}
41-
html.grainient-on .VPNavBar {
39+
background-color: transparent !important;
40+
}
41+
/* Dark translucent glass in BOTH states. VitePress adds `.fill` on scroll and
42+
paints the bar with the opaque light `--vp-nav-bg-color`; without this the
43+
pill turns white and the light nav text becomes white-on-white. The
44+
`!important` beats `.VPNavBar.fill`'s higher specificity. */
45+
html.grainient-on .VPNavBar,
46+
html.grainient-on .VPNavBar.fill {
4247
margin: 14px auto 0;
4348
max-width: calc(100% - 48px);
4449
padding: 0 10px;
4550
border-radius: 18px;
46-
background-color: rgba(255, 255, 255, 0.08);
4751
border: 1px solid rgba(255, 255, 255, 0.16);
52+
background-color: rgba(10, 14, 20, 0.32) !important;
4853
-webkit-backdrop-filter: blur(14px) saturate(140%);
4954
backdrop-filter: blur(14px) saturate(140%);
5055
}
56+
/* a touch more opaque once content scrolls behind it, for legibility */
57+
html.grainient-on .VPNavBar.fill {
58+
background-color: rgba(10, 14, 20, 0.66) !important;
59+
}
5160
html.grainient-on .VPNavBar .container {
5261
max-width: none;
5362
}
5463
html.grainient-on .VPNavBar .divider,
5564
html.grainient-on .VPNavBar .curtain {
56-
display: none;
65+
display: none !important;
5766
}
5867

5968
/* light nav content on the pill */

0 commit comments

Comments
 (0)