Skip to content

Commit 92ea9ee

Browse files
committed
[SLOP(claude-opus-4-8[1m]-medium)] fix(website): fix docs styling issues
1 parent 5f2344d commit 92ea9ee

4 files changed

Lines changed: 39 additions & 4 deletions

File tree

website/src/components/DocsTabs.tsx

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/src/components/v2/Header.tsx

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/src/content/docs/self-hosting/index.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,33 @@ description: "Self-hosting Rivet gives you complete control over the actor orche
44
skill: false
55
---
66

7+
{/* Mermaid measures each node label's foreignObject width using its default
8+
sans font, but the docs body font (JetBrains Mono) is wider, so the rendered
9+
label overflows the measured foreignObject and its `overflow: hidden` clips the
10+
text. Forcing the diagram labels back to a normal sans stack makes the rendered
11+
width match Mermaid's measurement so every label fits inside its node box. The
12+
overflow/centering rules are a belt-and-suspenders fallback so any residual
13+
width difference spills symmetrically inside the already-wide node rect instead
14+
of clipping on the right. */}
15+
<style>{`
16+
pre.mermaid .nodeLabel,
17+
pre.mermaid .edgeLabel,
18+
pre.mermaid .cluster-label,
19+
pre.mermaid foreignObject *,
20+
pre.mermaid text {
21+
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
22+
}
23+
pre.mermaid foreignObject {
24+
overflow: visible;
25+
}
26+
pre.mermaid foreignObject > div,
27+
pre.mermaid .nodeLabel {
28+
width: max-content;
29+
max-width: none;
30+
margin: 0 auto;
31+
}
32+
`}</style>
33+
734
## Self-Host vs BYOC
835

936
**Self-Host**

website/src/layouts/DocsLayout.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ interface Props {
1111
}
1212
1313
const { title, description, canonicalUrl, sidebar } = Astro.props;
14+
const pathname = Astro.url.pathname;
1415
---
1516

1617
<BaseLayout title={title} description={description} canonicalUrl={canonicalUrl} themeColor="#EFEFEF">
17-
<Header variant="full-width" showDocsTabs={true} light={true} active="docs" sidebarData={sidebar} client:load />
18+
<Header variant="full-width" showDocsTabs={true} light={true} active="docs" sidebarData={sidebar} initialPathname={pathname} client:load />
1819
<div class="paper-grain selection-paper w-full relative z-10 font-sans">
1920
<div class="mx-auto w-full min-h-content flex flex-col md:grid md:grid-cols-docs" style="--header-height: 8.0625rem;">
2021
<slot />

0 commit comments

Comments
 (0)