Skip to content

feat(tokens): generalize text-align schema to alignment#840

Merged
GarthDB merged 1 commit into
mainfrom
feat/alignment-token-type
May 8, 2026
Merged

feat(tokens): generalize text-align schema to alignment#840
GarthDB merged 1 commit into
mainfrom
feat/alignment-token-type

Conversation

@GarthDB
Copy link
Copy Markdown
Member

@GarthDB GarthDB commented May 8, 2026

Description

Renames packages/tokens/schemas/token-types/text-align.json to alignment.json and broadens the schema's identity so it represents any single-axis alignment (horizontal, vertical, or text), not only horizontal text alignment.

Concrete schema changes:

  • File: text-align.jsonalignment.json (source + committed published mirror under docs/site/public/schemas/token-types/)
  • $id: …/token-types/text-align.json…/token-types/alignment.json
  • title: Text alignAlignment
  • description: now describes a generic single-axis alignment value
  • properties.$schema.const: updated to the new $id
  • value.enum: unchanged["start", "center", "end"]
  • value.default: unchanged"start"

The three text-align-* token names in packages/tokens/src/typography.json are unchanged; only their $schema URL is updated to point at the new schema.

Reference updates:

  • packages/tokens/schemas/token-file.json$ref updated and re-sorted alphabetically
  • sdk/core/src/figma/mapping.rsSKIP_SCHEMAS entry updated
  • docs/markdown/tokens/typography.md — type label and link href updated for the three text-align rows

Related 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 | end keyword vocabulary is identical for horizontal text alignment, vertical alignment, and box-level alignment along either axis. Naming the schema text-align forced future tokens (e.g. vertical-align-*) to either misuse the type or duplicate the schema. Generalizing to alignment lets all axis-keyword tokens share a single, accurately-named type.

How Has This Been Tested?

  • moon run tokens:test — all 20 tests pass, including tokenSchemaValidator which dynamically loads every schemas/token-types/*.json and validates every token in src/. The three text-align-* tokens validate against the new alignment.json.
  • cargo test in sdk/core — all 151 tests pass with the updated SKIP_SCHEMAS entry.
  • rg "text-align\.json" across the repo (excluding site/, CHANGELOG.md, and .next/) returns zero hits.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

The schema's published $id URL and on-disk file path both changed. Consumers that pin to the old $id or fetch the old path will need to update. A minor changeset has been added.

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

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-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: 5ad7f73

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

This PR includes changesets to release 6 packages
Name Type
@adobe/spectrum-tokens Minor
s2-tokens-viewer Patch
markdown-generator Patch
@adobe/spectrum-design-data-mcp Patch
token-csv-generator Patch
token-mapping-analyzer Patch

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

🎨 Token Changes Report

Tokens Changed (3)

Original Branch: main
New Branch: feat/alignment-token-type

Updated (3)

Updated Properties (3)
  • text-align-center
    • schema: text-align.json -> alignment.json
  • text-align-end
    • schema: text-align.json -> alignment.json
  • text-align-start
    • schema: text-align.json -> alignment.json

This comment was automatically generated by the token diff tool. 🤖

@GarthDB
Copy link
Copy Markdown
Member Author

GarthDB commented May 8, 2026

Run report for 5ad7f734

Total time: 1m 50s | Comparison time: 5m 33s | Estimated savings: 3m 42s (66.9% faster)

Action Time Status Info
⬛️ SetupProto(0.51.4) 0.1ms Skipped
🟩 SyncWorkspace 7.3ms Passed
🟩 SyncProject(component-schemas) 1.7s Passed
🟩 SyncProject(sdk) 1.7s Passed
🟩 SyncProject(design-system-registry) 0.5ms Passed
🟩 SyncProject(tokens) 0.5ms Passed
🟩 SyncProject(markdown-generator) 0.3ms Passed
🟩 SyncProject(viewer) 0.4ms Passed
🟩 SyncProject(site) 0.3ms Passed
⬛️ SetupToolchain(node:20.17.0) 1.7s Skipped
🟩 RunTask(site:copySpec) 1.8s Passed
🟩 SetupToolchain(rust:1.85.0) 16.9s Passed
🟩 InstallWorkspaceDeps(node:20.17.0) 15.4s Passed
🟩 InstallProjectDeps(node:20.17.0, sdk) 15.7s Passed
🟩 RunTask(tokens:buildManifest) 312.1ms Passed
🟩 InstallWorkspaceDeps(rust:1.85.0, sdk) 973.8ms Passed
🟩 RunTask(design-system-registry:test) 1.6s Passed
🟩 RunTask(site:generateToolsPage) 1.1s Passed
🟩 RunTask(sdk:codegen-check) 287.5ms Passed
🟩 RunTask(component-schemas:test) 3.4s Passed
And 15 more...
Expanded report
Action Time Status Info
🟩 RunTask(sdk:build) 56.9s Passed
🟩 RunTask(tokens:validateDesignData) 2.2s Passed
🟩 RunTask(tokens:verifyDesignDataSnapshot) 2.2s Passed
🟩 RunTask(tokens:verifyLegacyRoundtrip) 915.3ms Passed
🟩 RunTask(tokens:buildTokens) 1m 10s Passed
🟩 RunTask(tokens:build) 29.5ms Passed
🟩 RunTask(markdown-generator:generate) 846.2ms Passed
🟩 RunTask(viewer:prepare) 357.3ms Passed
🟩 RunTask(site:copyContent) 209.2ms Passed
🟩 RunTask(viewer:export) 176.2ms Passed
🟩 RunTask(tokens:test) 9.2s Passed
🟩 RunTask(site:build) 9.1s Passed
🟩 RunTask(site:export) 24.8ms Passed
🟩 RunTask(sdk:lint) 1m 22s Passed
🟩 RunTask(sdk:test) 1m 29s Passed
Touched files
.changeset/generalize-text-align-to-alignment.md
docs/markdown/tokens/typography.md
docs/site/public/schemas/token-types/alignment.json
docs/site/public/schemas/token-types/text-align.json
packages/tokens/schemas/token-file.json
packages/tokens/schemas/token-types/alignment.json
packages/tokens/schemas/token-types/text-align.json
packages/tokens/src/typography.json
sdk/core/src/figma/mapping.rs

@GarthDB GarthDB merged commit b11942c into main May 8, 2026
6 checks passed
@GarthDB GarthDB deleted the feat/alignment-token-type branch May 8, 2026 17:42
@GarthDB GarthDB mentioned this pull request May 8, 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