Feat/tweaks#241
Draft
Benonii wants to merge 5 commits into
Draft
Conversation
Adds a typed, opt-in `DocsConfig.tweaks` field that mounts a runtime theme tweaker. Reader mode exposes accent, density, radius, preset, and font; author mode adds the full 16-token grid, sidebar/content/TOC width sliders, and exportable createTheme / CSS snippets. Persisted via localStorage with a pre-paint FOUC script that injects a `<style>` block in `<head>` rather than mutating `<html>`/`<body>` inline — so consumers don't need `suppressHydrationWarning`. Inspired by Claude's design tweaks dialog and the framework's own theme-customizer in the official example site.
|
@Benonii is attempting to deploy a commit to the farming-labs Team on Vercel. A member of the Team first needs to authorize it. |
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.
Draft PR of the tweaks dialog implementation
Summary by cubic
Add a runtime Tweaks dialog to live‑tune the docs theme. Reader mode gives visitors simple controls; author mode unlocks full tokens, layout sliders, and TS/CSS export with FOUC-safe style injection to avoid hydration issues.
New Features
DocsConfig.tweaks(off by default) in@farming-labs/docs:true | false | TweaksConfig(trueshorthands to{ author: true }).reader(accent, density, radius, preset, font) andauthor(all 16 color tokens, sidebar/content/TOC widths, export tocreateThemeor CSS).<style>in<head>(no inline mutations, no hydration warnings). Auto‑included whentweaksis enabled.position: "sidebar-footer" | "floating" | "both" | "manual").localStoragewithstorageKey,persist, andonApplyanalytics hook.packages/fumadocs:./tweakswithTweaksControl,TweaksAutoPortalTrigger,TweaksSidebarTrigger,TweaksFoucScript.tweaks.css; density scaling via--fd-font-scaleapplied inbase.css.tweakswith reader mode in prod and author mode in dev (Next setsposition: "both").Migration
tweaks: { reader: true }ortweaks: { author: process.env.NODE_ENV !== "production" }.position(default"both"). For manual placement, set"manual"and renderTweaksSidebarTrigger.fontOptions(e.g.,["Inter", "Geist", "system-ui"]).persist: falseor changestorageKeyas needed.Written for commit 81154e2. Summary will update on new commits.