Skip to content

feat(tokens): add editorial typography family#1940

Open
OneHunnid wants to merge 2 commits into
mainfrom
worktree-editorial-typography-rollout
Open

feat(tokens): add editorial typography family#1940
OneHunnid wants to merge 2 commits into
mainfrom
worktree-editorial-typography-rollout

Conversation

@OneHunnid

@OneHunnid OneHunnid commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Adds a Sora-based editorial typography token family for brand-themed surfaces (empty states, hero moments, announcements) that need the marketing-site type system rather than the utility scale.

Proposal: Editorial Typography Tokens — LaunchPad proposal (Phase 1 only; Phase 2 is a separate gonfalon PR for the Sora global preload).

What's in

  • fontFamily.sora with an Inter fallback so surfaces rendering before the Sora @font-face resolves (or in the authenticated bundle before Phase 2 ships) drop cleanly to LaunchPad's base sans-serif.
  • fontSize.editorial.{14..80} rungs — pixel-named to match the size primitives. The original proposal used 100/200/.../1300 step rungs but style-dictionary's CSS font-shorthand emitter mis-tokenizes 4-digit rung names starting with 1 (it splits e.g. 1300 into a synthetic line-height reference + trailing digits). Pixel-value names avoid the bug and are self-documenting.
  • fontWeight.editorial.{medium,semibold,bold} namespace — 500/600/700 mirroring the brand DEFAULT_WEIGHT map in ai-refresh/components/Text/index.tsx.
  • lineHeight.editorial.{tight,snug,close,default,relaxed} — unitless multipliers (1, 1.05, 1.1, 1.15, 1.5) per _typography.scss.
  • letterSpacing — brand-new top-level token group with editorial.* sub-namespace. Consumers apply this alongside the --lp-text-editorial-* shorthand since CSS font shorthand does not include letter-spacing.
  • 7 text.editorial.* compositions — display, h1, h1-alt, h2, h2-alt, h2-medium, h3. Sora-only; Söhne mixins deferred pending Klim licensing.
  • size.30 and size.50 primitives added to size.json.

Source of truth

All numeric values mirror _typography.scss and the DEFAULT_WEIGHT map from launchdarkly-nextjs/ai-refresh.

Verification

  • pnpm build passes
  • All 7 typography compositions emit clean CSS shorthand (e.g. --lp-text-editorial-display: var(--lp-font-weight-editorial-bold) var(--lp-font-size-editorial-80)/var(--lp-line-height-editorial-tight) var(--lp-font-family-sora);)
  • stories/typography.stories.tsx is data-driven via flatten(vars.text) — editorial tokens appear automatically in Storybook with no code change

Test plan

  • Storybook renders the 7 new editorial tokens under Tokens/Typography
  • Empty-state mock using var(--lp-text-editorial-h1) + var(--lp-letter-spacing-editorial-tight-em-05) renders at 64px Sora Bold with -0.05em tracking
  • No regression on existing text.heading.*, text.body.*, text.display.* compositions (no token references changed)
  • Visual specimen sign-off in Utility vs Editorial Typography Sets Figma file

Follow-ups (not in this PR)

  • Register Figma text styles in 🚀 LaunchPad under a new "Editorial" section
  • Phase 2: gonfalon PR to move Sora @font-face + preload out of the unauthenticated bundle gate (planned as a fairytale-gated guarded rollout)

via LD Research 🤖


Note

Low Risk
Additive token and documentation changes only; no changes to existing utility typography references or runtime application logic in this PR.

Overview
Introduces a Sora-based editorial typography family alongside existing utility tokens, aimed at brand moments (empty states, announcements, hero copy). New primitives include fontFamily.sora (with Inter/system fallbacks), pixel-named fontSize.editorial.*, fontWeight.editorial.*, unitless lineHeight.editorial.*, and a new top-level letterSpacing.editorial.* group—letter-spacing is referenced on compositions but must still be applied separately in CSS because font shorthand omits it. Seven text.editorial.* compositions (display through h3 variants) wire those primitives together; size.30 and size.50 were added to support editorial sizes.

Storybook Tokens/Typography is split into Utility and Editorial stories with framework copy and docs layout updates; editorial token labels get dedicated display-name handling. Existing utility text.* definitions are not modified.

Reviewed by Cursor Bugbot for commit 1316c55. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a Sora-based editorial typography token family for brand-themed
surfaces (empty states, hero moments, announcements) that need the
marketing-site type system rather than the utility scale.

- New `fontFamily.sora` with Inter fallback
- New `fontSize.editorial.{14..80}` rungs (pixel-named to match size
  primitives; avoids style-dictionary CSS font-shorthand emitter
  mis-tokenizing 4-digit rung names)
- New `fontWeight.editorial.{medium,semibold,bold}` namespace
- New unitless `lineHeight.editorial.{tight,snug,close,default,relaxed}`
- New top-level `letterSpacing` group with `editorial.*` sub-namespace
  (consumers apply alongside the typography shorthand since CSS font
  shorthand does not include letter-spacing)
- 7 new `text.editorial.*` compositions: display, h1, h1-alt, h2, h2-alt,
  h2-medium, h3 — Sora-only; Söhne mixins deferred pending licensing
- Adds `size.30` and `size.50` primitives required by the new scale

Source of truth: `_typography.scss` and `Text/index.tsx` DEFAULT_WEIGHT
map in launchdarkly-nextjs/ai-refresh.

Phase 2 (gonfalon Sora global preload + fairytale rollout) lands in a
separate PR — see Editorial Typography Tokens proposal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@OneHunnid OneHunnid requested review from a team as code owners June 24, 2026 17:06
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1316c55

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown
yarn add https://pkg.pr.new/@launchpad-ui/components@1940.tgz
yarn add https://pkg.pr.new/@launchpad-ui/icons@1940.tgz
yarn add https://pkg.pr.new/@launchpad-ui/tokens@1940.tgz

commit: 1316c55

@nhironaka nhironaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update storybook to demonstrate the new font?

Replaces the single Typography story with two stories so each section
renders with its own heading and description above its own canvas.
Custom docs page (Title + Description + Stories with includePrimary
and no section title) skips the default Primary canvas and removes
the "Stories" separator heading.

Editorial label rendering: getDisplayText now handles editorial keys
by expanding h1/h2/h3 to "Heading 1/2/3" with alt and medium kept as
variant suffixes. Component description mentions the two type sets
and links to the Utility & Editorial Type System proposal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1316c55. Configure here.


if (weight) {
return `${category.charAt(0).toUpperCase() + category.slice(1)} ${size} - ${weight.charAt(0).toUpperCase() + weight.slice(1)}`;
return `${capitalize(category)} ${size} - ${capitalize(weight)}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorial tokens use div elements

Low Severity

The typography story adds editorial-h1, editorial-h2, and editorial-h3 tokens, but getSemanticElement still keys off the first segment only. Those keys resolve to the editorial category, which falls through to a generic div, so samples and the copy-to-clipboard snippet use div instead of the matching heading tags.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1316c55. Configure here.

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.

2 participants