Repository navigation
frontend(fix): share one Tailwind entry for docs and blog on the site radius scale - #576
Conversation
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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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 configurationConfiguration used: Repository: Ducksss/payload-components/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Ducksss/payload-components/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe 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. ChangesSite presentation
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
Merge Risk: ⚪ Minimal · up to 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 ReviewSecurity architecture risk: 🔵 Low · up to 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 Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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.)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…, already contained here)
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]>
Summary
docs.cssandblog.csseach run a second Tailwind build for the Fumadocs preset. That build's ownrounded-sm/md/lg/xlutilities compiled to Tailwind's stock radius scale and loaded afterglobals.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:/,/components/docs/*,/blog/*beforerounded-smrounded-mdrounded-lgrounded-xlrounded-2xl/3xlThat covered 180–260 elements per docs page: Fumadocs' sidebar, search, cards, callouts, code blocks and prose tables, plus every
rounded-mdin the sharedSiteHeader, 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.cssalso still lacked the font and--color-fd-success/--color-fd-errorre-declarations #575 gavedocs.css, so/blogpainted.SF NSandMenloinstead 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 inlineradius block identical toglobals.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
/..prose tablereadsvar(--radius-lg)directly, and Tailwind still emits that variable, now asvar(--radius), so tables go from 8px to 10px rather than losing their rounding.community-driven-roadmapandtext-anchors-vs-aston desktop.docs.css, so the partial itself is a pure refactor.Visual baselines
blog-visual: re-minted by dispatchingvisual-baselines.ymlon this branch withspec=blog-visual update=all(run).allis needed because the radius change alone stays under the 1% tolerance, sochangedcould 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".components-visualandtemplates-visualdon'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 checksdocs.cssandblog.css. It also treats an inlineglobals.csstoken that the stock theme defines as a collision regardless of value, and requires the entry to match both value andinlineflag. 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 fordocs.css; the radius, font and fd-color tokens (11) forblog.css. The wiring test now asserts the Tailwind and preset imports in the partial.tests/e2e/frontend.e2e.spec.ts:/docs/installationand/blog/what-is-a-payload-cms-blockmust resolve the same fonts, fd colors androunded-sm…2xlradii as the landing page.Verification
pnpm lint,pnpm exec tsc --noEmit,pnpm format:check: pass.pnpm run test:int: 793 passed, 1 skipped.E2E_PORT=3100 pnpm build:e2e, thenPLAYWRIGHT_SERVER_MODE=production pnpm run test:e2e): exit 0 across all five batches.frontendhad 151 passed and 1 skipped;templates-a11yhad 63 passed; the remaining specs had 191 passed and 5 skipped. Pixel comparisons skip on macOS by design.globals.cssvariables shadowed, and zero radius utility collisions left. The remaining differences are.containerwidth 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@sourcepath resolves.Heads-up
docs.css, which this PR reduces to a single import. Its CSS can follow the import unchanged, and its[data-editorial]font block becomes redundant: fonts are site-wide on docs since frontend(fix): restore site typefaces and brand OG cards on docs routes #575.rounded-md, so on docs and blog it is now 8px, as on/.public/favicon.svgand the OG cards draw the mark atrx="6"of 24; that mismatch was already there on the landing page.No issues closed this cycle.
🤖 Generated with Claude Code
Summary by CodeRabbit