Skip to content

docs: modernize homepage code examples below the hero - #313

Merged
alexgrozav merged 1 commit into
mainfrom
agent/larousse/0de46cda
Jul 15, 2026
Merged

alexgrozav merged 1 commit into
mainfrom
agent/larousse/0de46cda

Conversation

@alexgrozav

Copy link
Copy Markdown
Contributor

Summary

The docs homepage promised "current styleframe" but three of the four example blocks below the hero taught stale idioms. This audits every block and refreshes the ones that had drifted, grounding each against the live API and the canonical API docs. The hero example was already correct and is untouched.

What changed, block by block

1. "Compose your system from existing parts"
The block declared const { colorPrimary, colorSecondary } = useColorDesignTokens(...) and then never used those names — an unused-variable smell that makes a reader distrust the example. useColorDesignTokens registers its tokens as a side effect, so the call is now made directly, and the sibling composables are aligned on the real use*DesignTokens naming convention.

2. "One source, every theme"
Replaced the stale pattern of merge()-ing two separate styleframe() instances (one "light", one "dark") plus hyphenated variable('color-primary', ...) tokens. Merging two instances to build a theme is not how theming works today and teaches the wrong mental model. The block now shows the canonical single-source pattern from /docs/api/themes — base tokens on one instance with theme('dark', (ctx) => ctx.variable(...)) — and dot-notation token names (color.surface), which are what actually compile to --color--surface.

3. "Zero-Runtime by Default"
The recipe used the old positional signature recipe('button', {...}, {...}). The current API is a single named-object argument: recipe({ name, base, variants, defaultVariants }) (verified in engine/core/src/tokens/recipe.ts and mirrored in /docs/api/recipes). Also corrected the CSS var in the sibling output block from --color-primary to the real --color--primary that dot-notation tokens generate.

4. Utility Scanner markup
Already current (_padding:lg, _hover:background:secondary, _gap:[1rem] all match today's utility/modifier syntax) — left unchanged.

Verification

  • pnpm install --frozen-lockfile (fresh workspace) — ok
  • pnpm --filter @styleframe/docs build — build complete, homepage content parses and renders (only a benign sharp darwin-arm64 image warning, unrelated)
  • Fence/container balance checked: 6 code blocks, no orphaned ::tabs, all ::browser-frame blocks balanced

Notes / findings

  • docs-craft recommends pnpm --filter @styleframe/docs typecheck, but @styleframe/docs has no typecheck script — the build is the real gate here. Flagging the skill inaccuracy for follow-up.
  • No changeset: @styleframe/docs is in the changesets ignore list.

Closes SF-30.

Audit and refresh the stale example blocks on the docs homepage so the
landing page teaches the current styleframe idioms:

- Compose section: drop the unused colorPrimary/colorSecondary
  destructure; call useColorDesignTokens for its side effect and align
  the sibling composables on the use*DesignTokens naming.
- Themes section: replace the stale "merge two theme instances" pattern
  and hyphenated color-primary tokens with the canonical single-source
  theme('dark', ctx => ...) config and dot-notation tokens.
- Zero-runtime section: update the recipe to the current single named-
  object signature recipe({ name, base, variants, defaultVariants }) and
  fix the CSS var to the real --color--primary output.

Scanner utility-class block was already current and left unchanged.
@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dd56d77

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
styleframe-dev Ready Ready Preview, Comment Jul 15, 2026 5:48am
styleframe-dev-storybook Ready Ready Preview, Comment Jul 15, 2026 5:48am

Request Review

@alexgrozav
alexgrozav merged commit 7766945 into main Jul 15, 2026
14 checks passed
@alexgrozav
alexgrozav deleted the agent/larousse/0de46cda branch July 15, 2026 05:48

This branch was successfully deployed

2 active deployments
Preview – styleframe-dev — dd56d77f Deployed Jul 15, 2026 by vercel[bot]
Preview – styleframe-dev-storybook — dd56d77f Deployed Jul 15, 2026 by vercel[bot]
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