Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@terrazzo/token-tools

terrazzoapp121.5kMIT0.8.1TypeScript support: included

Various utilities for token types

design tokens, dtcg, cli, w3c, design system, typescript, sass, css, style tokens, style system, linting, lint

readme

@terrazzo/token-tools

Install

npm install @terrazzo/token-tools

changelog

@terrazzo/token-tools

0.8.1

Patch Changes

0.8.0

Minor Changes

0.7.4

Patch Changes

  • #485 84335da Thanks @drwpow! - Add transform API to allow dynamic parsing / transformation of tokens on load

0.7.3

Patch Changes

0.7.2

Patch Changes

  • #477 0e24810 Thanks @dzonatan! - [plugin-css] add baseSelector option to css plugin to allow changing the root selector

0.7.1

Patch Changes

  • #468 2c28957 Thanks @drwpow! - When downsampling colors for sRGB gamut, preserve the originally-authored colorspace

0.7.0

Minor Changes

  • #454 44ff082 Thanks @drwpow! - ⚠️ Breaking change: the new color token object format uses "components" instead of "channels". Please update your tokens accordingly.

0.6.3

Patch Changes

  • #443 8cc558f Thanks @drwpow! - Bugfix: allow resolving from node_modules in @terrazzo/cli (note: @terrazzo/parser/JS API still runs in browser, so it still can’t resolve npm modules).

0.6.2

Patch Changes

0.6.1

Patch Changes

  • #427 af57a80 Thanks @drwpow! - feat: parse() JS API doesn’t need an array for a single file (can just accept an object)

0.6.0

Minor Changes

  • #425 9a98ab0 Thanks @drwpow! - feat: ⚠️ Breaking change: aliasing to specific modes (# character) is deprecated. It was an experimental feature in Cobalt 1.0 with unpredictable behavior. In some upcoming spec changes it will be incompatible with advanced usecases.

  • #425 9a98ab0 Thanks @drwpow! - fix: Improvements to mode aliasing and mode overrides. typography tokens only have to partially-declare overrides for modes, while keeping their core set. While this has been supported, behavior was buggy and sometimes was inconsistent.

  • #425 9a98ab0 Thanks @drwpow! - ⚠️ Breaking change: cubicBezier tokens no longer support aliases as values, in line with the spec.

Patch Changes

  • #425 9a98ab0 Thanks @drwpow! - fix: Improved handling of modes partially overriding object tokens (e.g. typography modes modifying a single value). In plugin-css, for instance, you may notice more output, but it’s done for safer style generation.

  • #425 9a98ab0 Thanks @drwpow! - feat: Further improved reverse alias lookups to be more accurate and more complete

  • #425 9a98ab0 Thanks @drwpow! - fix: Better error messages on alias mismatches

  • #425 9a98ab0 Thanks @drwpow! - fix: [plugin-css] Font Family names without spaces no longer get quotes.

    fix: Font Family tokens are always normalized to an array internally for easier parsing.

  • #425 9a98ab0 Thanks @drwpow! - feat: @terrazzo/plugin-css now returns entire token for variableName. This is a minor breaking change from variableName(name: string)variableName(token: Token), but current users can just use token.id to get the same value as before.

    ⚠️ Minor internal breaking change as a result: transformCSSValue() in @terrazzo/token-tools now requires entire token️ to make this possible.

  • #425 9a98ab0 Thanks @drwpow! - fix: ⚠️ [plugin-css] Minor breaking change: transition tokens no longer generate variables for sub-parts. This is a change done in service to better protect “allowed” token usage. If you want consumers to be able to “break apart” tokens, then they must also exist as individual tokens that get aliased.

0.5.0

Minor Changes

  • #420 ff3d9d1 Thanks @drwpow! - fix: ⚠️ Breaking change: CSS aliases will revert to original 1.0 behavior and be “shallow,” meaning they’ll be preserved as-written. Terrazzo 2.0 (beta) attempted to simplify aliases to only be single-depth, but that results in unintentional behavior.

Patch Changes

  • #420 ff3d9d1 Thanks @drwpow! - fix: Improve reverse alias lookups (needed for plugin-css, where redeclared base tokens need downstream aliases to be redeclared too, so the values aren’t stale)

  • #419 3962918 Thanks @drwpow! - Improve CLI logging and debugging for performance testing

  • #420 ff3d9d1 Thanks @drwpow! - fix: Minor performance improvements and cleanup

  • #420 ff3d9d1 Thanks @drwpow! - fix: CSS utilities alphabetize declarations to produce more consistent output. Reordering tokens should be a plugin-level concern; parser will preserve token authoring order.

0.4.0

Minor Changes

  • #416 822c956 Thanks @drwpow! - ⚠️ Breaking change: CSS variables updated to closer match Cobalt 1.0 behavior

Patch Changes

0.3.5

Patch Changes

0.3.4

Patch Changes

  • #408 6f97566 Thanks @drwpow! - Fix bug where setTransform() would not properly deduplicate token values

0.3.3

Patch Changes

0.3.2

Patch Changes

  • #396 4d1294d Thanks @drwpow! - Color tokens: add hex fallback for tokens parsed from hex

0.3.1

Patch Changes

0.3.0

Minor Changes

  • #391 8e6810c Thanks @drwpow! - ⚠️ Breaking change: Remove dash around numbers in CSS var names

0.2.9

Patch Changes

  • #387 f14224b Thanks @drwpow! - Fix incorrect parsing of typography tokens’ lineHeight when it’s a dimension value.

  • #387 f14224b Thanks @drwpow! - Fix warning on parsing dimension tokens in typography tokens

0.2.8

Patch Changes

0.2.7

Patch Changes

0.2.6

Patch Changes

  • #374 cb64063 Thanks @drwpow! - Add normalize CLI command, which can upgrade a giant tokens file to the latest DTCG format.

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

0.0.6

Patch Changes