Skip to content

feat: publish the type scale as --vlab-type-* tokens - #7

Merged
rqbazan merged 1 commit into
mainfrom
feat/type-tokens
Oct 17, 2026
Merged

rqbazan merged 1 commit into
mainfrom
feat/type-tokens

Conversation

@rqbazan

@rqbazan rqbazan commented Oct 17, 2026

Copy link
Copy Markdown
Member

Summary

The type scale in typography.md becomes tokens. tokens.json is its source, and the table in the chapter is now generated from it.

 tokens/tokens.json
   color, syntax, font
+  type: display, title, heading, lead, body, small, ui, inline-code, code, meta, label
+        each { size, line-height?, weight, tracking, family: "sans" | "mono" }

 pnpm build
   tokens.css     --vlab-<token>, --vlab-syntax-*, --vlab-font-*
+                 --vlab-type-<step>-size | -line-height | -weight | -tracking | -family
   theme.css      --color-*, --font-*
+                 --text-<step> with --line-height, --letter-spacing, --font-weight (Tailwind's text-<step>)
   color.md       palette and syntax tables
+  typography.md  the scale table, <!-- build:scale -->
  • A step with no line height (ui, inline-code, meta, label) has no -line-height token: it keeps the one of the text it sits in.
  • -family is var(--vlab-font-sans) or var(--vlab-font-mono), so the stacks still live in one place.
  • The two notes that sat in table cells move under the table: ui sets 500 for a name, and inline-code is set in ink. The step inline code is spelled inline-code, as its tokens are.
  • typography.md gets an "In code" section naming the tokens, the Tailwind utilities and tokens.json. color.md and AGENTS.md point to them.
  • Minor changeset: tokens are added, none removed or renamed.

Evidence

  • Before: pnpm check passes, with no type tokens; www's src/styles/site.css copies the scale by hand into .type-*.
    After: pnpm build writes tokens.css, theme.css and typography.md; pnpm check exits 0. Each generated value matches www's .type-* rules exactly, property by property:

    for each step in tokens.json.type
      compare font-size, line-height, font-weight, letter-spacing, font-family
        with www's .type-<step>
    → all match (www's .type-inline-code also sets color: var(--vlab-ink), which stays in www)
    

Merge Danger

Door: two-way until the release, then one-way.

Once chore: update versions publishes, the --vlab-type-* and text-<step> names are public: renaming one later is a major release.

Blast Radius: additive.

New custom properties on :root and new Tailwind font sizes only. None of the step names collide with Tailwind's default text-* sizes or with the color tokens. www and env's docsite read tokens.json by group name (color, syntax, font), so the new type group doesn't touch them, and env imports tokens.css, not theme.css.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N8f1sEEDiR2ikgqtHWXgYn

tokens.json holds the scale under `type`. The build writes each step to
tokens.css as --vlab-type-<step>-size, -line-height, -weight, -tracking
and -family, to theme.css as Tailwind's text-<step>, and to the scale
table in typography.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N8f1sEEDiR2ikgqtHWXgYn
@changeset-bot

changeset-bot Bot commented Oct 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9589742

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@variablelab/brand Minor

Not sure what this means? Click here to learn what changesets are.

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

@rqbazan
rqbazan merged commit 16b4e3b into main Oct 17, 2026
2 checks passed
@rqbazan
rqbazan deleted the feat/type-tokens branch October 17, 2026 20:17
@vland-bot vland-bot Bot mentioned this pull request Oct 17, 2026
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