Skip to content

refactor(src-tokens): convert syntax to W3C DTCG format#14146

Open
matgalla wants to merge 18 commits intodevfrom
matgalla/12266-convert-src-tokens-to-dtcg-format
Open

refactor(src-tokens): convert syntax to W3C DTCG format#14146
matgalla wants to merge 18 commits intodevfrom
matgalla/12266-convert-src-tokens-to-dtcg-format

Conversation

@matgalla
Copy link
Copy Markdown
Contributor

@matgalla matgalla commented Mar 21, 2026

Related Issue: #12089

Summary

Note: no final design token names or values are affected

  • updates all src token files with Tokens Studio's preferred W3C DTCG format
  • updates design token build process to account for the additional $ characters
  • reorders keys within tokens for consistency and cleanliness

@matgalla matgalla self-assigned this Mar 21, 2026
@github-actions github-actions bot added the refactor Issues tied to code that needs to be significantly reworked. label Mar 21, 2026
@matgalla matgalla changed the title refactor(tokens): convert src token syntax to W3C DTCG format refactor(src-tokens): convert syntax to W3C DTCG format Mar 21, 2026
@matgalla matgalla added the skip visual snapshots Pull requests that do not need visual regression testing. label Mar 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Mar 29, 2026
@matgalla matgalla removed the Stale Issues or pull requests that have not had recent activity. label Mar 30, 2026
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed skip visual snapshots Pull requests that do not need visual regression testing. labels Apr 7, 2026
@jcfranco jcfranco requested a review from Copilot April 7, 2026 23:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the @esri/calcite-design-tokens source token JSON files to Tokens Studio’s preferred W3C DTCG format (switching type/value/description to $type/$value/$description) and updates the Style Dictionary build pipeline to read the new DTCG properties so generated outputs remain stable.

Changes:

  • Convert core + semantic token sources to DTCG ($type, $value, $description) without changing token names/values.
  • Update build utilities/transforms/filters/formatters to use token.$type/token.$value and token.original.$value.
  • Adjust Token Studio / Style Dictionary override logic to work with DTCG token shapes.

Reviewed changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/design-tokens/src/tokens/semantic/z-index.json Convert semantic z-index tokens to DTCG keys.
packages/design-tokens/src/tokens/semantic/typography.json Convert semantic typography tokens to DTCG keys (including nested values and extensions).
packages/design-tokens/src/tokens/semantic/space.json Convert semantic spacing/space tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/semantic/size.json Convert semantic size tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/semantic/shadow.json Convert semantic shadow tokens to DTCG keys.
packages/design-tokens/src/tokens/semantic/opacity.json Convert semantic opacity tokens to DTCG keys.
packages/design-tokens/src/tokens/semantic/font.json Convert semantic font tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/semantic/corner-radius.json Convert semantic corner-radius tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/semantic/container-size.json Convert semantic container-size (breakpoint) tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/semantic/color/light.json Convert semantic light color tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/semantic/color/dark.json Convert semantic dark color tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/semantic/border.json Convert semantic border tokens to DTCG keys.
packages/design-tokens/src/tokens/core/z-index.json Convert core z-index tokens to DTCG keys.
packages/design-tokens/src/tokens/core/size.json Convert core size tokens to DTCG keys.
packages/design-tokens/src/tokens/core/shadow.json Convert core shadow tokens to DTCG keys.
packages/design-tokens/src/tokens/core/opacity.json Convert core opacity tokens to DTCG keys.
packages/design-tokens/src/tokens/core/font.json Convert core font tokens to DTCG keys and $description.
packages/design-tokens/src/tokens/core/container-size.json Convert core container-size tokens to DTCG keys.
packages/design-tokens/src/tokens/core/$themes.json Convert Tokens Studio theme metadata to DTCG keys.
packages/design-tokens/src/tokens/core/$metadata.json Convert Tokens Studio metadata to DTCG keys.
packages/design-tokens/src/build/utils/token-types.ts Update token-type helpers to use .$type.
packages/design-tokens/src/build/utils/output-references.ts Update output reference logic to use .$type.
packages/design-tokens/src/build/utils/get-number-and-unit.ts Update numeric parsing helper to prioritize .$value.
packages/design-tokens/src/build/transforms/value/px-to-rem.ts Update px→rem transform to use .$type/.$value and simplify filter typing.
packages/design-tokens/src/build/transforms/value/merge-value.ts Return token.$value from merge-value transform.
packages/design-tokens/src/build/transforms/value/ensure-type.ts Use token.$type/token.$value for ensure-type transform.
packages/design-tokens/src/build/transforms/value/correct-prop-name.ts Update corrected-prop-name transform to use .$type/.$value.
packages/design-tokens/src/build/transforms/value/correct-pretransform-value.ts Update preprocessing correction transform to use .$type/.$value.
packages/design-tokens/src/build/transforms/value/correct-posttransform-value.ts Update postprocessing correction transform to use .$type/.$value.
packages/design-tokens/src/build/transforms/name/include-plus-minus.ts Update plus/minus name transform filtering to use .$type.
packages/design-tokens/src/build/preprocessors/store-same-value-theme-tokens.ts Update themed token merge preprocessor to use .$value (partially).
packages/design-tokens/src/build/overrides/index.ts Update built-in + Tokens Studio override transforms to manipulate .$type/.$value.
packages/design-tokens/src/build/format/typography.ts Read unresolved typography values from token.original.$value.
packages/design-tokens/src/build/format/docs.ts Serialize docs output using token.$value.
packages/design-tokens/src/build/filter/semantic.ts Update semantic filter to use .$type.
packages/design-tokens/src/build/filter/global.ts Update global filter to use .$type.
packages/design-tokens/src/build/filter/core.ts Update core filter to use .$type.

jcfranco and others added 2 commits April 7, 2026 16:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 8, 2026
@jcfranco jcfranco requested a review from Copilot April 8, 2026 00:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 38 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

packages/design-tokens/src/tokens/core/size.json:349

  • Within core.size.rem.0-875, there is still a nested legacy token object ("1": { "value": ..., "type": ... }). This breaks the stated goal of converting src tokens to DTCG and may be interpreted as an actual child token by Tokens Studio/Style Dictionary. Remove this nested legacy entry or convert it to valid DTCG (or rename if it was meant to be a grouping node).
        "0-875": {
          "1": {
            "value": "1",
            "type": "sizing",
            "attributes": {

@matgalla matgalla force-pushed the matgalla/12266-convert-src-tokens-to-dtcg-format branch from 2c87be1 to 6bea949 Compare April 10, 2026 02:20
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 10, 2026
@jcfranco jcfranco requested a review from Copilot April 10, 2026 04:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 39 changed files in this pull request and generated 3 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 39 changed files in this pull request and generated 1 comment.

@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 10, 2026
@jcfranco jcfranco marked this pull request as ready for review April 10, 2026 19:31
@matgalla
Copy link
Copy Markdown
Contributor Author

@jcfranco f75fb70 just reordered the keys within the src tokens, which does come with test snapshot updates (af72e51), FYI. No tokens themselves were reordered and no values should have changed.

@matgalla matgalla added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 10, 2026
@matgalla matgalla requested a review from Copilot April 10, 2026 21:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 39 changed files in this pull request and generated no new comments.

@matgalla matgalla requested a review from isaacbraun April 10, 2026 21:48
@matgalla
Copy link
Copy Markdown
Contributor Author

@isaacbraun Will the additional $s in front of the values, descriptions, and types be a problem for the doc site?

Copy link
Copy Markdown
Contributor

@isaacbraun isaacbraun left a comment

Choose a reason for hiding this comment

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

LGTM!

Will the additional $s in front of the values, descriptions, and types be a problem for the doc site?

Yes, we will have to update all of those property references to support this change. Think we will have to coordinate the doc site PR merge with whenever the Tokens package with these changes releases to next.

@matgalla
Copy link
Copy Markdown
Contributor Author

matgalla commented Apr 10, 2026

We can wait on merging this then, but we should make an internal issue for the doc site side of things then.

As for package releases, I'll defer to this convo, but I'm wondering if doc-site specific updates like this (that don't impact users directly) should be something other than refactors 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr ready for visual snapshots Adding this label will run visual snapshot testing. refactor Issues tied to code that needs to be significantly reworked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants