feat(tokens): generalize text-align schema to alignment#840
Merged
Conversation
Rename packages/tokens/schemas/token-types/text-align.json to alignment.json so the schema represents any single-axis alignment (horizontal, vertical, or text). Update title, description, $id, and the internal $schema const. The enum (start | center | end) and default (start) are unchanged. Existing text-align-* token names are unchanged; only their $schema reference URL is updated. Refs: spectrum-design-data-urk Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5ad7f73 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
Contributor
🎨 Token Changes ReportTokens Changed (3)Original Branch: Updated (3)Updated Properties (3)
This comment was automatically generated by the token diff tool. 🤖 |
Member
Author
Run report for 5ad7f734Total time: 1m 50s | Comparison time: 5m 33s | Estimated savings: 3m 42s (66.9% faster)
Expanded report
Touched files |
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.
Description
Renames
packages/tokens/schemas/token-types/text-align.jsontoalignment.jsonand broadens the schema's identity so it represents any single-axis alignment (horizontal, vertical, or text), not only horizontal text alignment.Concrete schema changes:
text-align.json→alignment.json(source + committed published mirror underdocs/site/public/schemas/token-types/)$id:…/token-types/text-align.json→…/token-types/alignment.jsontitle:Text align→Alignmentdescription: now describes a generic single-axis alignment valueproperties.$schema.const: updated to the new$idvalue.enum: unchanged —["start", "center", "end"]value.default: unchanged —"start"The three
text-align-*token names inpackages/tokens/src/typography.jsonare unchanged; only their$schemaURL is updated to point at the new schema.Reference updates:
packages/tokens/schemas/token-file.json—$refupdated and re-sorted alphabeticallysdk/core/src/figma/mapping.rs—SKIP_SCHEMASentry updateddocs/markdown/tokens/typography.md— type label and linkhrefupdated for the three text-align rowsRelated Issue
N/A — initiated from a request to make the schema reusable for the new vertical/box-alignment work coming up.
Motivation and Context
The
start | center | endkeyword vocabulary is identical for horizontal text alignment, vertical alignment, and box-level alignment along either axis. Naming the schematext-alignforced future tokens (e.g.vertical-align-*) to either misuse the type or duplicate the schema. Generalizing toalignmentlets all axis-keyword tokens share a single, accurately-named type.How Has This Been Tested?
moon run tokens:test— all 20 tests pass, includingtokenSchemaValidatorwhich dynamically loads everyschemas/token-types/*.jsonand validates every token insrc/. The threetext-align-*tokens validate against the newalignment.json.cargo testinsdk/core— all 151 tests pass with the updatedSKIP_SCHEMASentry.rg "text-align\.json"across the repo (excludingsite/,CHANGELOG.md, and.next/) returns zero hits.Types of changes
The schema's published
$idURL and on-disk file path both changed. Consumers that pin to the old$idor fetch the old path will need to update. Aminorchangeset has been added.Checklist: