Skip to content

feat(docsite): live theme + template previews on landing feature cards - #3064

Merged
rubyycheung merged 3 commits into
mainfrom
docsite/landing-live-feature-previews
Jun 24, 2026
Merged

rubyycheung merged 3 commits into
mainfrom
docsite/landing-live-feature-previews

Conversation

@rubyycheung

Copy link
Copy Markdown
Contributor

Summary

Replaces the two baked PNGs on the home page Features bento (/feature-brand.png, /feature-templates.png) with live, dark-mode-aware previews built from the real components/templates.

  • Themes card (ThemesPreview): renders the real /themes ThemeShowcaseStore (Butter theme + content) in a <Theme> scope, fluidly scaled to a miniature cropped to the first section (nav + hero + product cards). An AppShellMobileContext override forces the store's desktop grid so it doesn't collapse inside the scaled tile. Static Butter swatches + script "Aa" rail. Left-anchored/bled on the narrow 3-column card, centered on the wide single-column card, bottom-anchored, with an elevation shadow.
  • Templates card (TemplatesPreview): a grid of live, scaled-down real page templates via TemplateThumbnail, framed as elevated tiles. Narrow desktop card → 2-up rows (the middle row is 3-up with the login template centered), uniform tile size. Wide single-column card → dissolves into a 3-per-line × 2-row grid (one template dropped to avoid an orphan).
  • TemplateThumbnail: adds optional aspectRatio, renderWidth (full-page miniature vs. the legacy zoomed-in slice), and borderRadius props. Defaults preserve existing /templates usage.
  • Components / CLI previews: marked inert + pointer-events: none (decorative, non-interactive).
  • globals.css: scopes the embedded theme-showcase nav to the themed body color so the home-page nav overrides don't leak a mismatched band into the preview.

Both previews are responsive via container queries (keyed to the card width, not the viewport), so they look right in the narrow 3-column bento and the wide single-column stack.

Test plan

  • / home page renders; Themes + Templates feature cards show live previews (light + dark mode).
  • Resize narrow: Themes preview stays centered & uncramped; Templates collapses to 3-per-line × 2 rows (no huge tiles, no orphan).
  • /themes page still renders correctly (shared TemplateThumbnail change is backward-compatible).
  • /templates page thumbnails unchanged.
  • No nested-radius artifact on template tiles; elevation shadows present.
  • ESLint clean; StyleX capability scan confirms all used features (@container, aspect-ratio, calc(), grid/flex) are supported.

🤖 Generated with Cursor

Made with Cursor

Replace the baked /feature-brand.png and /feature-templates.png on the home
"Features" bento with live, dark-mode-aware previews:

- Themes card (ThemesPreview): renders the real /themes ThemeShowcaseStore in a
  Butter <Theme> scope, fluidly scaled to a miniature cropped to the first
  section (nav + hero + products). Forces the store's desktop grid via an
  AppShellMobileContext override so it never collapses inside the scaled tile.
  Static Butter swatches + script "Aa" rail; left-anchored/bled on the narrow
  3-column card, centered on the wide single-column card; bottom-anchored;
  elevation shadow.
- Templates card (TemplatesPreview): a grid of live, scaled-down real page
  templates (TemplateThumbnail) framed as elevated tiles. Narrow desktop card:
  2-up rows (middle row 3-up with login centered), uniform tile size. Wide
  single-column card: dissolves into a 3-per-line x 2-row grid (one template
  dropped to avoid an orphan).
- TemplateThumbnail: add optional aspectRatio, renderWidth (full-page miniature
  vs zoomed slice), and borderRadius props; defaults preserve existing usage.
- Components/CLI previews: mark inert + pointer-events:none (decorative).
- globals.css: scope the embedded theme-showcase nav to the themed body color so
  the home-page nav overrides don't leak a mismatched band into the preview.

Co-authored-by: Cursor <[email protected]>
@vercel

vercel Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
astryx Ignored Ignored Jun 24, 2026 8:19pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Vercel Preview Deployment

Status ✅ Deployed
Preview Open Preview
Commit 1c2bf8c
Inspect Vercel Dashboard
Workflow View Logs

No authentication required — anyone with the link can view the preview.

rubyycheung and others added 2 commits June 24, 2026 15:15
Replace the hardcoded Butter hex values for the swatches + "Aa" wordmark with
the theme's own CSS vars (--color-accent, --color-background-yellow,
--color-background-body), resolved by wrapping the rail in a Butter <Theme>
scope. Keeps the same appearance but stays in sync with the theme and follows
light/dark like the rest of the preview.

Co-authored-by: Cursor <[email protected]>
Fix now-stale comments (the swatch rail is theme-token-driven and wrapped in a
Butter <Theme> scope, not "static"/outside-scope) and tighten a few verbose
preview-replacement notes.

Co-authored-by: Cursor <[email protected]>
@rubyycheung
rubyycheung merged commit a31df5d into main Jun 24, 2026
17 checks passed
@github-actions
github-actions Bot deleted the docsite/landing-live-feature-previews branch July 12, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants