Repository navigation
Conversation
Text applies one of the ten typography roles with the variant prop. Heading roles render h2, body roles render p, and label and code roles render span. The render prop (Base UI) sets the element, such as the heading level. Color and modifiers stay in className. Add a compile test that a consumer leading-none, font-medium, or tracking class overrides a prefixed role. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the Text docs page with examples, mention Text in the Typography section of the styling guide, add typography rules to the component design reference, and record the Text decisions in decisions/typography-roles.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Code Metrics Report
Details | | main (95bc8f2) | #594 (5da98aa) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 88.7% | 88.7% | +0.0% |
| Files | 208 | 210 | +2 |
| Lines | 6285 | 6289 | +4 |
+ | Covered | 5575 | 5579 | +4 |
- | Test Execution Time | 2m21s | 2m26s | +5s |Code coverage of files in pull request scope (0.0% → 100.0%, patch 100.0%)
Reported by octocov |
Treat variant={null} as body-md instead of rendering a p with no role.
Use eslint-disable comments, which ESLint and oxlint both read. Keep the
card title as h3 in the component design example, state that core
components do not use the roles yet, update the ADR header, show where
element-specific attributes go, and drop the ad-hoc overline example.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dance A role can already be applied with the text-<role> utility or with Text, so textVariants stays internal. Generalize the docs lint note to the jsx-a11y rules that check element content, and keep card titles as headings in the Text docs and the styling guide pairing table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs-manifest.json
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.
Motivation
#572 added typography role tokens. This PR adds a
Textcomponent on top of them (tailor-inc/platform-planning#1580).variantsets the look, and therenderprop sets the element, so the heading level no longer decides the text size. No existing component changes.Where this fits
text-<role>utilities.Textfor application code. Role names are type-checked. A misspelled utility such astext-label-mddproduces no CSS and no error.Text.Design Decision
variantholds the role. It is not calledrole, becauseroleis an ARIA attribute.rendersets the element, as inButton.h2, body roles renderp, and label and code roles renderspan. All headings share one default, so the size does not suggest a level.leading-nonestay inclassName.code-smaddsfont-mono.Textdoes not export a cva function such astextVariants. #1580 asked for a variants export, but thetext-<role>utility already covers that use. It can be added later without a breaking change.jsx-a11y/heading-has-contentreportsrender={<h3 />}as an empty heading. The docs show aneslint-disable-next-linecomment for this, instead of adding a second way to set the element, such as alevelprop.The reasons for each decision are in
decisions/typography-roles.md.Question for reviewers
The cream and bloom palettes set the line height and letter spacing of
h1toh6outside any@layer, so these headings ignoreleading-none. Should this rule move into a layer, or be removed, before the next PR applies the roles to headings?🤖 Generated with Claude Code