Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ repos:
language: system
files: ^docs/fern/(main\.css|components/CustomFooter\.tsx|scripts/sync_site_css\.py)$
pass_filenames: false
- id: check-asset-paths
name: Check docs asset paths are ones Fern rewrites
entry: python3 docs/fern/scripts/check_asset_paths.py
language: system
files: ^docs/fern/(components/.*\.tsx?|(pages|translations)/.*\.mdx?|main\.css|custom\.js|docs\.yml|scripts/check_asset_paths\.py)$
- id: pytest-marker-report
name: Report pytest markers (static + inherited)
entry: python3 tests/report_pytest_markers.py
Expand Down
217 changes: 33 additions & 184 deletions docs/fern/components/LandingStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@
* Landing page component styles (Home and Community).
*
* Styles for WelcomeHero, WhyDynamo, EventsCalendar and CommunityLanding.
* These rules also live in main.css, which is the local-preview and no-JS
* baseline; this block is what reaches production.
* This block is their only home -- main.css carries none of these rules, so
* there is no fallback baseline. If this block does not render, both pages
* render unstyled. (CustomFooter.tsx is the one that genuinely mirrors
* main.css, enforced by the `sync-site-css` pre-commit hook.)
*
* Delivered as a page-level <style> block (NOT via the docs.yml `css:` field)
* so it survives the shared NVIDIA global theme, which replaces project `css`
* at publish. The same theme also replaces the custom `footer:`, so the
* SITE_CSS block in CustomFooter.tsx does not reach these pages either --
* that is why the Home and Community components rendered unstyled. Same
* pattern as ReferenceStyles.tsx and RecipeStyles.tsx, which are unaffected
* for exactly this reason.
* at publish (#11952) -- production ships no main.css <link> at all. Same
* pattern as ReferenceStyles.tsx and RecipeStyles.tsx.
*
* main.css content does still reach production, mirrored verbatim into
* CustomFooter.tsx's SITE_CSS by sync_site_css.py, and that block does render
* on these pages. It is not somewhere to put landing rules, though: it is
* generated, so any hand edit is overwritten on the next sync.
*
* Injected via dangerouslySetInnerHTML, like RecipeStyles.tsx, not as a text
* child like ReferenceStyles.tsx. A text child is escaped on render, which
Expand All @@ -34,8 +38,8 @@
* regex-scans this file for imports without skipping comments, and a quoted
* non-relative specifier makes it shell out to `npx rolldown` on every build.
*
* Then place <LandingStyles /> once, right after the imports, on welcome.mdx
* and community/README.mdx.
* Then place <LandingStyles /> once, right after the imports, on
* pages/home/index.mdx and pages/community/community.mdx.
*/
const LANDING_CSS = `
/* ===================== Welcome (Home) landing page ===================== */
Expand Down Expand Up @@ -102,27 +106,36 @@ article:has(.dynamo-welcome)::before {
/* Turn Fern's generated title and subtitle into the first half of the hero. */
article:has(.dynamo-welcome) > header {
margin: 0;
padding: clamp(3rem, 6vh, 4.5rem) 1rem 0;
/* The extra top padding reserves the space the mark below occupies, since
the mark is taken out of the flow to sit above the heading. */
padding: calc(clamp(3rem, 6vh, 4.5rem) + 92px + 1.45rem) 1rem 0;
text-align: center;
}

article:has(.dynamo-welcome) > header::before {
content: "";
/* The Dynamo mark, rendered as an <img> from the page MDX. It cannot be a
background-image here: Fern rewrites asset paths only in MDX and docs.yml,
never inside a <style> string, so a url() reaches the browser verbatim and
404s. That puts the mark in the prose, below the heading, so pull it back up
over the heading; the header padding above holds its place. */
article:has(.dynamo-welcome) .dynamo-welcome__mark {
position: absolute;
top: clamp(3rem, 6vh, 4.5rem);
Comment thread
dagil-nvidia marked this conversation as resolved.
Resolved
left: 50%;
transform: translateX(-50%);
Comment thread
dagil-nvidia marked this conversation as resolved.
Resolved
display: block;
width: 92px;
height: 92px;
margin: 0 auto 1.45rem;
margin: 0;
border: 1px solid rgba(118, 185, 0, 0.4);
border-radius: 24px;
background: #f3fbdc
url("/dynamo/assets/img/dynamo-logo.svg") center /
cover no-repeat;
background-color: #f3fbdc;
object-fit: cover;
box-shadow:
0 18px 42px rgba(54, 86, 0, 0.24),
inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dark article:has(.dynamo-welcome) > header::before {
.dark article:has(.dynamo-welcome) .dynamo-welcome__mark {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment thread
dagil-nvidia marked this conversation as resolved.
Resolved
border-color: rgba(118, 185, 0, 0.4);
background-color: #0c0d0b;
box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
Expand Down Expand Up @@ -483,146 +496,6 @@ article:has(.dynamo-welcome) > header .fern-page-subtitle p {
}
}

/* App-notification community stack on wide screens; it moves below the demo when space is tight. */
.dynamo-welcome__community {
position: absolute;
top: -20rem;
right: calc((100vw - 1200px) / -2 + 1rem);
z-index: 30;
display: flex;
width: 242px;
flex-direction: column;
gap: 0.55rem;
}

.dynamo-welcome__notification {
display: grid;
grid-template-columns: 2.55rem 1fr;
gap: 0.7rem;
align-items: center;
min-height: 4.3rem;
padding: 0.65rem 0.75rem;
border: 1px solid rgba(255, 255, 255, 0.58);
border-radius: 18px;
background:
radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.74), transparent 45%),
linear-gradient(145deg, rgba(250, 250, 250, 0.72), rgba(231, 235, 226, 0.62));
color: var(--grayscale-a12) !important;
box-shadow:
0 18px 46px rgba(28, 38, 18, 0.14),
inset 0 1px 0 rgba(255, 255, 255, 0.88);
text-decoration: none !important;
backdrop-filter: blur(24px) saturate(1.4);
transition:
transform 160ms ease,
border-color 160ms ease,
box-shadow 160ms ease;
}

.dark .dynamo-welcome__notification {
border-color: rgba(255, 255, 255, 0.12);
background:
radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.12), transparent 45%),
linear-gradient(145deg, rgba(35, 38, 31, 0.78), rgba(14, 16, 12, 0.7));
box-shadow:
0 18px 46px rgba(0, 0, 0, 0.42),
inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.dynamo-welcome__notification:hover,
.dynamo-welcome__notification:focus-visible {
transform: translateX(-4px);
border-color: rgba(118, 185, 0, 0.55);
box-shadow: 0 18px 42px rgba(54, 86, 0, 0.2);
}

.dynamo-welcome__notification:focus-visible {
outline: 3px solid rgba(118, 185, 0, 0.34);
outline-offset: 3px;
}

.dynamo-welcome__notification-icon {
display: grid;
width: 2.55rem;
height: 2.55rem;
place-items: center;
border-radius: 11px;
color: white;
box-shadow:
0 5px 14px rgba(0, 0, 0, 0.18),
inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dynamo-welcome__notification--slack .dynamo-welcome__notification-icon {
background: #4a154b;
}

.dynamo-welcome__notification--calendar .dynamo-welcome__notification-icon {
background: #ff3b30;
}

.dynamo-welcome__notification-icon svg {
width: 1.42rem;
height: 1.42rem;
fill: currentColor;
}

.dynamo-welcome__calendar-app {
display: grid;
width: 1.55rem;
height: 1.65rem;
grid-template-rows: 0.55rem 1fr;
overflow: hidden;
border-radius: 5px;
background: white;
color: #171717;
text-align: center;
}

.dynamo-welcome__calendar-app > span {
display: grid;
place-items: center;
background: #ff3b30;
color: white;
font-size: 0.38rem;
font-weight: 800;
letter-spacing: 0.03em;
}

.dynamo-welcome__calendar-app strong {
display: grid;
place-items: center;
font-size: 0.72rem;
line-height: 1;
}

.dynamo-welcome__notification-copy {
display: flex;
min-width: 0;
flex-direction: column;
gap: 0.18rem;
color: var(--grayscale-a11);
font-size: 0.76rem;
line-height: 1.25;
}

.dynamo-welcome__notification-app {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 0.5rem;
color: var(--grayscale-a12);
font-size: 0.78rem;
font-weight: 700;
}

.dynamo-welcome__notification-app small {
color: var(--grayscale-a9);
font-size: 0.65rem;
font-weight: 500;
text-transform: uppercase;
}

/* Scroll-driven feature story: copy advances on the left while one large visual stays pinned. */
.dynamo-story {
display: grid;
Expand Down Expand Up @@ -1487,21 +1360,6 @@ article:has(.dynamo-welcome) > header .fern-page-subtitle p {
margin: 0;
}

@media (max-width: 1360px) {

.dynamo-welcome__community {
position: static;
width: min(100%, 720px);
margin: 2rem auto 0;
flex-direction: row;
}

.dynamo-welcome__notification {
flex: 1;
min-width: 0;
}
}

@media (max-width: 960px) {

.dynamo-story {
Expand Down Expand Up @@ -1553,13 +1411,13 @@ article:has(.dynamo-welcome) > header .fern-page-subtitle p {
}

article:has(.dynamo-welcome) > header {
padding-top: 2.75rem;
padding-top: calc(2.75rem + 60px + 1rem);
}

article:has(.dynamo-welcome) > header::before {
article:has(.dynamo-welcome) .dynamo-welcome__mark {
top: 2.75rem;
width: 60px;
height: 60px;
margin-bottom: 1rem;
border-radius: 14px;
}

Expand Down Expand Up @@ -1599,14 +1457,6 @@ article:has(.dynamo-welcome) > header .fern-page-subtitle p {
line-height: 1.65;
}

.dynamo-welcome__community {
width: min(100%, 350px);
flex-direction: column;
}

.dynamo-welcome__notification {
width: 100%;
}
.dynamo-story__step {
margin-bottom: 3.5rem;
}
Expand Down Expand Up @@ -1713,7 +1563,6 @@ article:has(.dynamo-welcome) > header .fern-page-subtitle p {
}

.dynamo-welcome__cta,
.dynamo-welcome__notification,
.dynamo-story__step,
.dynamo-story__step-copy,
.dynamo-story__stage-panel {
Expand Down
2 changes: 1 addition & 1 deletion docs/fern/components/TerminalDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* import { TerminalDemo } from "@/components/TerminalDemo";
*
* <TerminalDemo
* src="/dynamo/assets/dynamo-demo.cast"
* src="../../assets/dynamo-demo.cast" // relative, so Fern rewrites it
* startAt={0}
* endAt={18} // play only the first 18s of a long recording, then loop
* idleTimeLimit={2} // compress dead air so pauses feel snappy
Expand Down
Loading
Loading