Skip to content

feat: add runtime theme tweaks - #477

Draft
Kinfe123 wants to merge 1 commit into
feat/devtools-editor-draftfrom
feat/runtime-theme-tweaks-draft
Draft

feat: add runtime theme tweaks#477
Kinfe123 wants to merge 1 commit into
feat/devtools-editor-draftfrom
feat/runtime-theme-tweaks-draft

Conversation

@Kinfe123

@Kinfe123 Kinfe123 commented Aug 14, 2026

Copy link
Copy Markdown
Member

Status

Draft and stacked on #476. This restores the work from the original PR #241 so it can continue being developed independently before merging.

Scope

  • Runtime theme tweak configuration and UI.
  • Framework bundle and adapter integration.
  • Related exports, styles, examples, and tests from the original change.

History

The original PR was reverted by #474 because it was not ready to ship. This branch reproduces the original PR tree exactly when combined with #476, without unrelated changes.

Merge order

Merge #476 first. Then retarget this PR to main, update it, and complete its review.


Summary by cubic

Adds an opt‑in runtime “Tweaks” dialog to docs so readers can adjust preset, accent, density, radius, and font, and authors can adjust all tokens and export a createTheme({...}) snippet. Selections persist in localStorage and reapply pre‑paint to avoid FOUC; nothing changes unless enabled.

  • Opt in via defineDocs as tweaks: { reader: true, author: process.env.NODE_ENV !== 'production', position?: 'sidebar' | 'floating' | 'both' }. Defaults off.
  • Integrates in layout by mounting TweaksControl/TweaksAutoPortalTrigger and injecting a pre‑paint script from buildFoucScript(); adds tweaks.css to base styles.
  • Exposes types and components: TweaksConfig in @farming-labs/docs; TweaksAutoPortalTrigger, TweaksControl, and triggers in @farming-labs/fumadocs; new subpath export @farming-labs/fumadocs/tweaks.
  • Main review focus: packages/fumadocs/src/tweaks-runtime.ts (persistence, FOUC prevention) and packages/fumadocs/src/tweaks-dialog.tsx (UI, token application). Examples enable tweaks for local dev.

Written for commit de74965. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview Aug 14, 2026 12:04pm
farming-labs-docs-docs-cloud Building Building Preview Aug 14, 2026 12:04pm

Request Review

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.

1 participant