Skip to content

frontend(fix): share one Tailwind entry for docs and blog on the site radius scale - #576

Merged
Ducksss merged 4 commits into
mainfrom
claude/second-entry-radius
Sep 30, 2026
Merged

Ducksss merged 4 commits into
mainfrom
claude/second-entry-radius

Conversation

@Ducksss

@Ducksss Ducksss commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #575. The first commit here is #575's. Merge #575 first; this branch then rebases to its own single commit.

Summary

docs.css and blog.css each run a second Tailwind build for the Fumadocs preset. That build's own rounded-sm / md / lg / xl utilities compiled to Tailwind's stock radius scale and loaded after globals.css, where those classes are inlined onto --radius (0.625rem). On a fresh production build (E2E_PORT=3100 pnpm build:e2e), the same class resolved differently:

Utility /, /components /docs/*, /blog/* before after
rounded-sm 6px 4px 6px
rounded-md 8px 6px 8px
rounded-lg 10px 8px 10px
rounded-xl 14px 12px 14px
rounded-2xl/3xl 16 / 24px 16 / 24px same

That covered 180–260 elements per docs page: Fumadocs' sidebar, search, cards, callouts, code blocks and prose tables, plus every rounded-md in the shared SiteHeader, which measured 8px on / and 6px on docs and blog. DESIGN.md sets the base radius at 0.625rem and says controls use it.

blog.css also still lacked the font and --color-fd-success / --color-fd-error re-declarations #575 gave docs.css, so /blog painted .SF NS and Menlo instead of Geist.

Both entries now import src/app/fumadocs.css. It holds the Tailwind and Fumadocs imports plus every re-declaration: the breakpoint, the fonts, the fd colors, and a new @theme inline radius block identical to globals.css's. The two routes can no longer drift apart, and they compile to one shared chunk again (145 KB, the same size as before).

What changed on screen

  • Radius: only corners move. At the finest threshold (4/255) at most 0.17% of any page's pixels change, and no page changes height. Every utility and every shared-header element on docs and blog now measures the same as on /. .prose table reads var(--radius-lg) directly, and Tailwind still emits that variable, now as var(--radius), so tables go from 8px to 10px rather than losing their rounding.
  • Blog fonts: all 34 blog pages were captured before and after at 1440×900 and 390×844. All return 200, and none overflow horizontally before or after. Heights move −0.3%…+0.8% on desktop and −0.1%…+1.5% on mobile. Nine titles wrap one more line because Geist Bold sets wider than SF: seven on mobile, plus community-driven-roadmap and text-anchors-vs-ast on desktop.
  • Docs: captures are byte-identical to a build with the radius block inlined in docs.css, so the partial itself is a pure refactor.

Visual baselines

  • blog-visual: re-minted by dispatching visual-baselines.yml on this branch with spec=blog-visual update=all (run). all is needed because the radius change alone stays under the 1% tolerance, so changed could have left stale images. The mint opened test(chore): mint Linux visual baselines #577, which contained only those four PNGs. I checked them (Geist throughout, 4.4–10.6% of pixels changed, the font change being well past the 1% tolerance) and brought them in as a fast-forward, so the committed blobs are exactly the minted ones. The mint also picked up a stale detail in the old article baseline: it showed the date as "Tue Jul 14 2026" where current code renders "Jul 14, 2026".
  • Unaffected suites: landing, components-visual and templates-visual don't load the Fumadocs chunk, so nothing moves there.

Tests

  • tests/int/fumadocs-site.int.spec.ts: the drift test now inlines each entry's relative @imports and checks docs.css and blog.css. It also treats an inline globals.css token that the stock theme defines as a collision regardless of value, and requires the entry to match both value and inline flag. Against frontend(fix): restore site typefaces and brand OG cards on docs routes #575's files it fails with the exact gaps: six radius tokens for docs.css; the radius, font and fd-color tokens (11) for blog.css. The wiring test now asserts the Tailwind and preset imports in the partial.
  • tests/e2e/frontend.e2e.spec.ts: /docs/installation and /blog/what-is-a-payload-cms-block must resolve the same fonts, fd colors and rounded-sm…2xl radii as the landing page.

Verification

  • pnpm lint, pnpm exec tsc --noEmit, pnpm format:check: pass.
  • pnpm run test:int: 793 passed, 1 skipped.
  • Production e2e (E2E_PORT=3100 pnpm build:e2e, then PLAYWRIGHT_SERVER_MODE=production pnpm run test:e2e): exit 0 across all five batches. frontend had 151 passed and 1 skipped; templates-a11y had 63 passed; the remaining specs had 191 passed and 5 skipped. Pixel comparisons skip on macOS by design.
  • Compiled CSS: zero globals.css variables shadowed, and zero radius utility collisions left. The remaining differences are .container width rules with equal values and Fumadocs' own base-layer rules, all present before. The Fumadocs-only classes are still compiled (.bg-fd-card, .text-fd-muted-foreground, animate-fd-dialog-in), so the partial's @source path resolves.

Heads-up

No issues closed this cycle.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Documentation pages now have custom social-sharing images featuring the page title and relevant section details. Component pages also display their component family and installation command.
  • Improvements
    • Blog and documentation pages now share consistent typography, colors, and corner styling.
    • Social-sharing images support localized templates and blog and documentation pages, with clearer guidance on supported fonts and glyphs.

Ducksss and others added 2 commits September 30, 2026 17:20
docs.css imports Tailwind a second time for the Fumadocs preset, and that
build re-emits the stock theme into the same theme layer as globals.css,
after it. On every docs page that replaced Geist Sans, Geist Mono and
Instrument Serif with the system stacks, and --color-fd-success/error with
Fumadocs' own green and red. docs.css now re-declares the five tokens, and
an int test fails whenever a token globals.css emits would be shadowed on
the docs route without a matching re-declaration.

The docs OG route drew the stock fumadocs-ui/og card (dark, pink accent). It
now renders the site's light card: the favicon mark with a serif "docs"
lockup, the hero dot grid under the emerald wash, the sidebar section or
component family as an eyebrow, and the install command on component pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… radius scale

docs.css and blog.css each built Tailwind a second time for the Fumadocs
preset, and that build's own rounded-sm/md/lg/xl utilities compiled to the
stock radius scale and loaded after globals.css. Every such class on docs
and blog pages, Fumadocs chrome and the shared header included, rendered
2px squarer than the same class elsewhere. blog.css also still lacked the
font and fd-color re-declarations docs.css gained in the previous commit,
so /blog painted system fonts.

Both entries now import src/app/fumadocs.css, which carries the Tailwind and
Fumadocs imports plus every re-declaration (breakpoint, fonts, fd colors and
the inline radius scale), so the two routes cannot drift apart again and
share one compiled chunk. The int drift test resolves each entry's imports,
covers blog.css, and treats an inline token the stock theme also defines as
a collision that must match both value and inline flag. The e2e check now
covers a blog article and the radius scale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
payload-components Ready Ready Preview Sep 30, 2026 2:16pm UTC
payload-components-97bf Ready Ready Preview Sep 30, 2026 2:16pm UTC

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: Ducksss/payload-components/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 181686cb-42c1-4cc1-82b2-57aac5362972

📥 Commits

Reviewing files that changed from the base of the PR and between 16d852f and a92d4fe.

⛔ Files ignored due to path filters (4)
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-article-desktop-chromium-linux.png is excluded by !**/*.png
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-article-mobile-chromium-linux.png is excluded by !**/*.png
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-index-desktop-chromium-linux.png is excluded by !**/*.png
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-index-mobile-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • src/app/[locale]/docs/docs.css
  • tests/e2e/frontend.e2e.spec.ts
  • tests/int/fumadocs-site.int.spec.ts
 __________________________________________________________
< The happy path is delighted. The sad path is litigating. >
 ----------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Ducksss/payload-components/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 74b71907-d461-4af5-8fa6-d9dca9647d55

📥 Commits

Reviewing files that changed from the base of the PR and between c8ee9fd and 16d852f.

⛔ Files ignored due to path filters (4)
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-article-desktop-chromium-linux.png is excluded by !**/*.png
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-article-mobile-chromium-linux.png is excluded by !**/*.png
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-index-desktop-chromium-linux.png is excluded by !**/*.png
  • tests/e2e/blog-visual.e2e.spec.ts-snapshots/blog-index-mobile-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (7)
  • src/app/[locale]/blog/blog.css
  • src/app/[locale]/docs/docs.css
  • src/app/[locale]/og/docs/[...slug]/route.tsx
  • src/app/_fonts/README.md
  • src/app/fumadocs.css
  • tests/e2e/frontend.e2e.spec.ts
  • tests/int/fumadocs-site.int.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The changes add a shared Fumadocs stylesheet for docs and blog routes, update tests for theme token consistency, and replace the docs Open Graph image renderer with a custom card.

Changes

Site presentation

Layer / File(s) Summary
Shared Fumadocs theme and route wiring
src/app/fumadocs.css, src/app/[locale]/blog/blog.css, src/app/[locale]/docs/docs.css, tests/int/fumadocs-site.int.spec.ts, tests/e2e/frontend.e2e.spec.ts
The shared stylesheet defines Fumadocs imports and theme tokens. The docs and blog stylesheets import it. Integration and end-to-end tests check stylesheet wiring, token collisions, and rendered theme values.
Custom docs social cards
src/app/[locale]/og/docs/[...slug]/route.tsx, src/app/_fonts/README.md
The docs image route loads local fonts and visual assets, selects card content from page metadata, and renders a branded image. The README describes font usage and glyph coverage.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant DocsOgRoute
  participant PageTreeHelpers
  participant FileSystem
  participant ImageResponse
  DocsOgRoute->>PageTreeHelpers: Find page URL and sidebar section
  DocsOgRoute->>FileSystem: Load fonts and favicon
  DocsOgRoute->>ImageResponse: Pass card content and fonts
Loading

Merge Risk: ⚪ Minimal · up to 16d85

The shared docs/blog styling and branded docs social cards have no established merge-blocking issue. The change is mergeable after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 16d85

The image route retains its existing documentation lookup and missing-page handling. New card content comes from the resolved documentation and component registry, while assets use fixed local paths. No new privileged access or external fetch was established. Production resource limits and deployment guarantees remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The supported exposure is public documentation-card output and rendering resources. Additional displayed values originate from the resolved documentation page and repository-defined component entries; the examined flow establishes no new tenant, data-store, credential, or service authority.

Trust Boundaries and Controls

  • observed — The existing page-resolution and missing-page gate remains between public route parameters and rendered content. Fixed asset filenames prevent those parameters from selecting filesystem reads, and embedded assets avoid a new request-controlled remote-fetch destination in the inspected renderer.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: sharing one Tailwind entry for the docs and blog to maintain the site radius scale.
Description check ✅ Passed The description is detailed and covers the change, impact, testing, visual baselines, and stacked-PR context. It omits the template's Registry Checklist and Notes sections and does not explicitly chec…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ducksss
Ducksss merged commit 46a80cf into main Sep 30, 2026
13 of 16 checks passed
@Ducksss
Ducksss deleted the claude/second-entry-radius branch September 30, 2026 14:06
Ducksss added a commit that referenced this pull request Sep 30, 2026
Brings in #574 (retire dev, point everything at main), #575 (restore
site typefaces and brand OG cards on docs routes), and #576 (share one
Tailwind entry for docs and blog).

Resolves the docs.css conflict by keeping main's one-line import of
src/app/fumadocs.css and appending the editorial rules after it. The
editorial scope no longer re-declares --font-sans/mono/serif or the
--default-* pair: fumadocs.css now restores Geist and Instrument Serif
on every docs route, so that block was redundant. [data-editorial] keeps
only its section counter. Also drops the stale "restores the faces" line
from AGENTS.md and the DesignEditorial header comment.

Verified after the merge: painted fonts on /docs/design are Geist,
Instrument Serif for the accents, and Geist Mono for code and receipts.
source:build, tsc, lint, format:check, and test:int (794 passed) are
green, and the a11y and overflow e2e checks for /docs/design and
/about/case-study pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

2 active deployments
Preview – payload-components-97bf — a92d4fec Deployed Sep 30, 2026 by vercel[bot]
Preview – payload-components — a92d4fec Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants