feat: add runtime theme tweaks - #477
Draft
Kinfe123 wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.defineDocsastweaks: { reader: true, author: process.env.NODE_ENV !== 'production', position?: 'sidebar' | 'floating' | 'both' }. Defaults off.TweaksControl/TweaksAutoPortalTriggerand injecting a pre‑paint script frombuildFoucScript(); addstweaks.cssto base styles.TweaksConfigin@farming-labs/docs;TweaksAutoPortalTrigger,TweaksControl, and triggers in@farming-labs/fumadocs; new subpath export@farming-labs/fumadocs/tweaks.packages/fumadocs/src/tweaks-runtime.ts(persistence, FOUC prevention) andpackages/fumadocs/src/tweaks-dialog.tsx(UI, token application). Examples enabletweaksfor local dev.Written for commit de74965. Summary will update on new commits.