@terrazzo/token-tools
Install
npm install @terrazzo/token-tools
Various utilities for token types
npm install @terrazzo/token-tools
84335da
Thanks @drwpow! - Add transform API to allow dynamic parsing / transformation of tokens on load0e24810
Thanks @dzonatan! - [plugin-css] add baseSelector
option to css plugin to allow changing the root selector2c28957
Thanks @drwpow! - When downsampling colors for sRGB gamut, preserve the originally-authored colorspace44ff082
Thanks @drwpow! - ⚠️ Breaking change: the new color token object format uses "components" instead of "channels". Please update your tokens accordingly.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).af57a80
Thanks @drwpow! - feat: parse()
JS API doesn’t need an array for a single file (can just accept an object)#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.
#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.
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.#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.
822c956
Thanks @drwpow! - ⚠️ Breaking change: CSS variables updated to closer match Cobalt 1.0 behavior6f97566
Thanks @drwpow! - Fix bug where setTransform() would not properly deduplicate token values#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
cb64063
Thanks @drwpow! - Add normalize CLI command, which can upgrade a giant tokens file to the latest DTCG format.6b3c543
Thanks @christoph-fricke! - Fix npm error when invoking the Terrazzo CLI through npmb90287c
Thanks @tomasfrancisco! - Add support for inset shadows4bd7b85
Thanks @tomasfrancisco! - Improve typings for Group to allow nested Groups#339 9197405
Thanks @tomasfrancisco! - Fix missing letter spacing transformation as a dimension token
#341 a637f67
Thanks @drwpow! - Fix 0 durations missing units in CSS
e7f272d
Thanks @drwpow! - ⚠️ Breaking change: dimension and duration tokens normalize to object syntax in plugins (following upcoming changes in DTCG spec; see https://github.com/design-tokens/community-group/pull/244).