improvement(docs): align code blocks with the platform design system - #6810
improvement(docs): align code blocks with the platform design system#6810waleedlatif1 wants to merge 1 commit into
Conversation
Docs code blocks rendered in stock `github-light`/`github-dark` on fumadocs chrome, sharing no colors, typeface, metrics, or corner radius with the app. - Add Sim Shiki themes transcribed from emcn's Prism token colors, shared by the MDX pipeline and fumadocs-openapi (which highlights through its own instance, so the API reference was left on the GitHub palette). - Use the mono stack the app actually renders. `tailwind.config.ts` points `font-mono` at `--font-martian-mono`, but nothing defines that variable, so every code surface in the product resolves to the system stack. - Give blocks the platform's field chrome — `rounded-lg`, a `--border-1` hairline, a `--surface-5`/`--code-bg` fill — and the 13px/21px metrics of `Code.Viewer`. The rule keys on `figure.shiki` because two renderers emit these figures and that is the only join point they share. - Number every line, from the same tokens as the in-app gutter. Padding sits on `.line` rather than fumadocs' `--padding-left`: that property is re-declared on the inner `pre` for API samples, which dropped the digits on top of the code. - Collapse tabbed fences into one box with the strip as the title row, and align the inline-code chip with the app's markdown renderer. - Reuse emcn's `Button`, `useCopyToClipboard`, and chip chrome constants instead of re-deriving them, and drop ~90 lines of `!important` overrides, including a rule that could never match.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Typography and inline code switch to the system mono stack the app actually uses (Geist Mono removed from the docs layout), with inline chips matching the app’s markdown renderer and Block chrome is unified on Reviewed by Cursor Bugbot for commit 4a740e5. Configure here. |
Greptile SummaryThis PR aligns documentation code blocks with the platform design system.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/docs/app/global.css | Reworks documentation code-block, tab, gutter, copy-control, and inline-code presentation. |
| apps/docs/components/ui/code-block.tsx | Replaces the bespoke clipboard control with emcn primitives and copies sanitized code text through a figure ref. |
| apps/docs/lib/shiki-theme.ts | Defines shared Sim light and dark syntax-highlighting themes. |
| apps/docs/source.config.ts | Configures the MDX pipeline to use the shared Shiki themes. |
| apps/docs/app/[lang]/[[...slug]]/page.tsx | Applies the same Shiki configuration to OpenAPI-generated code samples. |
| apps/docs/components/ui/api-example-selector.tsx | Restyles the native API-example selector with emcn design-system primitives. |
| apps/docs/app/[lang]/layout.tsx | Removes the Geist Mono font registration after switching code surfaces to the platform system-monospace stack. |
Reviews (2): Last reviewed commit: "improvement(docs): align code blocks wit..." | Re-trigger Greptile
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4a740e5. Configure here.
Summary
github-light/github-darkon fumadocs chrome — no colors, typeface, metrics, or corner radius in common with the app. This aligns them.apps/sim/tailwind.config.tspointsfont-monoat--font-martian-mono, but nothing in the app ever defines that variable, so every code surface in the product resolves to the system stack.rounded-lg,--border-1hairline,--surface-5/--code-bgfill) andCode.Viewer's 13px/21px metrics. The rule keys onfigure.shikibecause two different renderers emit these figures and that is the only join point they share..linerather than fumadocs'--padding-left, which is re-declared on the innerprefor API samples and dropped the digits on top of the code.Button,useCopyToClipboard, and chip chrome constants instead of re-deriving them; removes ~90 lines of!importantoverrides, including afigure.shiki:not(div > figure.shiki)rule that could never match.Type of Change
Testing
Tested manually against the docs dev server across prose fences, tabbed fences, titled fences, and the API reference (request tabs, response tabs, usage tabs) in both themes. Smoke-tested 66 pages (40 content + 26 API reference) for 200s.
bun run lint,bun run type-check,check:audits(29 audits), and the block-registry check all pass.Two judgment calls worth a look in review:
packages/emcn/src/components/code/code.cssso the app and docs move together, rather than diverging here.Checklist