Skip to content

Releases: terrazzoapp/terrazzo

@terrazzo/[email protected]

15 Dec 14:58
043404d

Choose a tag to compare

Pre-release

@terrazzo/token-tools

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change; DTCG 2nd Editors draft format will throw errors by default. This means converting all colors and dimensions to the new object format.

    Though this is a breaking change in default behavior, you can opt back into the old behavior by adjusting your config’s lint settings. See https://terrazzo.app/docs/linting/.

    List of changes:

    • color: channels is invalid; components is required (“channels” was never part of the spec; this just deprecates an in-progress draft that was briefly supported)
    • dimension: object notation ({ value: 16, unit: 'px' }) required.
    • dimension: 0 is no longer automatically expanded to{ value: 0, unit: 'px' }.
    • duration: object notation ({ value: 100, unit: 'ms' }) required.
    • dimension: { $value: 0 } no longer allowed.
    • typography: fontFamily, fontSize, fontWeight, lineHeight, and letterSpacing are all required at a minimum (additional properties are still allowed).
  • #530 370ed7b Thanks @drwpow! - Soft deprecate core/required-typography-properties in favor of core/valid-typography

  • #530 370ed7b Thanks @drwpow! - ⚠️ Minor breaking change: the transform() API now returns the Momoa node as the 1st parameter. The 2nd parameter is now an object with more context. Lastly, it requires returning a momoa node, rather than raw JSON.

    + import * as momoa from "@humanwhocodes/momoa";
    
      transform: {
    -   color(json, path, node) {
    +   color(node, { path, filename }) {
    +     const json = momoa.evaluate(node);
    -     return json;
    +     return momoa.parse(json);
        }

    This should result in a little less work overall. For example, instead of writing if (typeof json === 'object' && !Array.isArray(json)) that could be shortened to if (node.type === 'Object'), among many other such advantages. You can call evaluate() manually if you’re more used to working with the raw JSON instead. Similarly, you can call parse() if you’re working with

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

  • #530 370ed7b Thanks @drwpow! - Minor breaking change: build() and buildEnd() plugin hooks are now executed in parallel. The other hooks are still executed sequentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: the following token types have more strict requirements about all properties being present:

    • Border
    • Transition
    • Typography

    These behaviors may be opted out individually by adjusting the new lint rules (see documentation).

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Fix bug where border tokens’ partial aliases would sometimes refer to themselves

  • #530 370ed7b Thanks @drwpow! - Fix bug of lint warning of rules turned off being unused

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #530 370ed7b Thanks @drwpow! - Add first class support for JSON $refs, both remote and local.

    Under-the-hood this transforms DTCG aliase to JSON $refs, so they’re interchangeable.

  • #530 370ed7b Thanks @drwpow! - Bugfix: fix strokeStyle partialAliasOf

  • #530 370ed7b Thanks @drwpow! - Add missing $deprecated property to group types

  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

  • #589 8f32d44 Thanks @michaelurban! - feat: add typography shorthand, improve Sass plugin

0.10.3

Patch Changes

0.10.2

Patch Changes

  • #526 085f657 Thanks @drwpow! - Update strokeStyle tokens to allow modern dimension syntax

0.10.1

Patch Changes

  • #510 4493731 Thanks @drwpow! - Reduce decimal places in color output.
    • [plugin-css] ⚠️ Minor breaking change: decimals have been simplified in output. To restore original behavior, pass in colorDepth: 'unlimited'

0.10.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

  • #507 0060100 Thanks @drwpow! - Fix a98-rgb colorSpace, accidentally referring to it as "a98"

0.9.1

Patch Changes

  • #502 c9792bd Thanks @drwpow! - Fix bug in parsing LAB colors

  • #502 c9792bd Thanks @drwpow! - Add support for lab65 colors (not technically part of CSS Module 4 spec, but a nice convenience)

0.9.0

Minor Changes

Read more

@terrazzo/[email protected]

15 Dec 14:57
043404d

Choose a tag to compare

Pre-release

@terrazzo/plugin-vanilla-extract

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #553 e63a627 Thanks @Sidnioulz! - Add support for the Token Listing format

  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

0.2.2

Patch Changes

0.2.1

Patch Changes

  • #510 4493731 Thanks @drwpow! - Reduce decimal places in color output.

    • [plugin-css] ⚠️ Minor breaking change: decimals have been simplified in output. To restore original behavior, pass in colorDepth: 'unlimited'
  • Updated dependencies [4493731]:

0.2.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

0.0.2

Patch Changes

0.0.1

Initial release

@terrazzo/[email protected]

15 Dec 14:57
043404d

Choose a tag to compare

Pre-release

@terrazzo/plugin-tailwind

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

0.3.3

Patch Changes

0.3.2

Patch Changes

0.3.1

Patch Changes

0.3.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

  • #497 9b80fd4 Thanks @bschlenk! - - potential 5x speedup for @terrazzo/plugin-css
    • removed isTokenMatch from @terrazzo/token-tools

Patch Changes

0.1.0

Minor Changes

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

0.0.2

Patch Changes

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

0.0.1

Patch Changes

@terrazzo/[email protected]

15 Dec 14:57
043404d

Choose a tag to compare

Pre-release

@terrazzo/plugin-sass

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

  • #589 8f32d44 Thanks @michaelurban! - feat: add typography shorthand, improve Sass plugin

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #553 e63a627 Thanks @Sidnioulz! - Add support for the Token Listing format

  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

0.10.4

Patch Changes

0.10.3

Patch Changes

0.10.1

Patch Changes

0.10.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

0.9.1

Patch Changes

0.9.0

Minor Changes

  • #497 9b80fd4 Thanks @bschlenk! - - potential 5x speedup for @terrazzo/plugin-css
    • removed isTokenMatch from @terrazzo/token-tools

Patch Changes

0.8.1

Patch Changes

0.8.0

Minor Changes

Patch Changes

0.7.4

Patch Changes

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

0.7.0

Minor Changes

  • #454 44ff082 Thanks @drwpow! - ⚠️ Breaking change: the new color token object format uses "components...
Read more

@terrazzo/[email protected]

15 Dec 14:58
043404d

Choose a tag to compare

Pre-release

@terrazzo/plugin-js

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.
  • #553 e63a627 Thanks @Sidnioulz! - Add support for the Token Listing format
  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

0.10.3

Patch Changes

0.10.1

Patch Changes

  • #510 4493731 Thanks @drwpow! - Reduce decimal places in color output.

    • [plugin-css] ⚠️ Minor breaking change: decimals have been simplified in output. To restore original behavior, pass in colorDepth: 'unlimited'
  • Updated dependencies [4493731]:

0.10.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

0.9.1

Patch Changes

0.9.0

Minor Changes

  • #497 9b80fd4 Thanks @bschlenk! - - potential 5x speedup for @terrazzo/plugin-css
    • removed isTokenMatch from @terrazzo/token-tools

Patch Changes

0.8.1

Patch Changes

0.8.0

Minor Changes

Patch Changes

0.7.3

Patch Changes

0.7.2

Patch Changes

0.7.1

Patch Changes

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.

Patch Changes

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](9a9...

Read more

@terrazzo/[email protected]

15 Dec 14:57
043404d

Choose a tag to compare

Pre-release

@terrazzo/plugin-css

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

  • #589 8f32d44 Thanks @michaelurban! - feat: add typography shorthand, improve Sass plugin

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #553 e63a627 Thanks @Sidnioulz! - Add support for the Token Listing format

  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

  • #606 1fc1d99 Thanks @yuheiy! - Allow partial utility CSS groups configuration

0.10.4

Patch Changes

0.10.3

Patch Changes

0.10.2

Patch Changes

0.10.1

Patch Changes

  • #510 4493731 Thanks @drwpow! - Reduce decimal places in color output.

    • [plugin-css] ⚠️ Minor breaking change: decimals have been simplified in output. To restore original behavior, pass in colorDepth: 'unlimited'
  • Updated dependencies [4493731]:

0.10.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

0.9.1

Patch Changes

0.9.0

Minor Changes

  • #497 9b80fd4 Thanks @bschlenk! - - potential 5x speedup for @terrazzo/plugin-css
    • removed isTokenMatch from @terrazzo/token-tools

Patch Changes

0.8.1

Patch Changes

0.8.0

Minor Changes

Patch Changes

0.7.4

Patch Changes

0.7.3

Patch Changes

0.7.2

Patch Changes

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

0.7.1

Patch Changes

0.7.0

Minor Changes

Read more

@terrazzo/[email protected]

15 Dec 14:58
043404d

Choose a tag to compare

Pre-release

@terrazzo/plugin-css-in-js

@terrazzo/[email protected]

15 Dec 14:57
043404d

Choose a tag to compare

Pre-release

@terrazzo/parser

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change; DTCG 2nd Editors draft format will throw errors by default. This means converting all colors and dimensions to the new object format.

    Though this is a breaking change in default behavior, you can opt back into the old behavior by adjusting your config’s lint settings. See https://terrazzo.app/docs/linting/.

    List of changes:

    • color: channels is invalid; components is required (“channels” was never part of the spec; this just deprecates an in-progress draft that was briefly supported)
    • dimension: object notation ({ value: 16, unit: 'px' }) required.
    • dimension: 0 is no longer automatically expanded to{ value: 0, unit: 'px' }.
    • duration: object notation ({ value: 100, unit: 'ms' }) required.
    • dimension: { $value: 0 } no longer allowed.
    • typography: fontFamily, fontSize, fontWeight, lineHeight, and letterSpacing are all required at a minimum (additional properties are still allowed).
  • #530 370ed7b Thanks @drwpow! - Soft deprecate core/required-typography-properties in favor of core/valid-typography

  • #530 370ed7b Thanks @drwpow! - ⚠️ Minor breaking change: the transform() API now returns the Momoa node as the 1st parameter. The 2nd parameter is now an object with more context. Lastly, it requires returning a momoa node, rather than raw JSON.

    + import * as momoa from "@humanwhocodes/momoa";
    
      transform: {
    -   color(json, path, node) {
    +   color(node, { path, filename }) {
    +     const json = momoa.evaluate(node);
    -     return json;
    +     return momoa.parse(json);
        }

    This should result in a little less work overall. For example, instead of writing if (typeof json === 'object' && !Array.isArray(json)) that could be shortened to if (node.type === 'Object'), among many other such advantages. You can call evaluate() manually if you’re more used to working with the raw JSON instead. Similarly, you can call parse() if you’re working with

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

  • #530 370ed7b Thanks @drwpow! - Minor breaking change: build() and buildEnd() plugin hooks are now executed in parallel. The other hooks are still executed sequentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: the following token types have more strict requirements about all properties being present:

    • Border
    • Transition
    • Typography

    These behaviors may be opted out individually by adjusting the new lint rules (see documentation).

  • #589 8f32d44 Thanks @michaelurban! - feat: add typography shorthand, improve Sass plugin

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Fix bug where border tokens’ partial aliases would sometimes refer to themselves

  • #530 370ed7b Thanks @drwpow! - Fix bug of lint warning of rules turned off being unused

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #530 370ed7b Thanks @drwpow! - Add first class support for JSON $refs, both remote and local.

    Under-the-hood this transforms DTCG aliase to JSON $refs, so they’re interchangeable.

  • #530 370ed7b Thanks @drwpow! - Bugfix: fix strokeStyle partialAliasOf

  • #530 370ed7b Thanks @drwpow! - Add missing $deprecated property to group types

  • #553 e63a627 Thanks @Sidnioulz! - Add support for the Token Listing format- #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

0.10.4

Patch Changes

0.10.3

Patch Changes

0.10.2

Patch Changes

  • #526 085f657 Thanks @drwpow! - Update strokeStyle tokens to allow modern dimension syntax

0.10.1

Patch Changes

  • #510 4493731 Thanks @drwpow! - Reduce decimal places in color output.

    • [plugin-css] ⚠️ Minor breaking change: decimals have been simplified in output. To restore original behavior, pass in colorDepth: 'unlimited'
  • Updated dependencies [4493731]:

0.10.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

Read more

@terrazzo/[email protected]

15 Dec 14:57
043404d

Choose a tag to compare

Pre-release

@terrazzo/cli

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change; DTCG 2nd Editors draft format will throw errors by default. This means converting all colors and dimensions to the new object format.

    Though this is a breaking change in default behavior, you can opt back into the old behavior by adjusting your config’s lint settings. See https://terrazzo.app/docs/linting/.

    List of changes:

    • color: channels is invalid; components is required (“channels” was never part of the spec; this just deprecates an in-progress draft that was briefly supported)
    • dimension: object notation ({ value: 16, unit: 'px' }) required.
    • dimension: 0 is no longer automatically expanded to{ value: 0, unit: 'px' }.
    • duration: object notation ({ value: 100, unit: 'ms' }) required.
    • dimension: { $value: 0 } no longer allowed.
    • typography: fontFamily, fontSize, fontWeight, lineHeight, and letterSpacing are all required at a minimum (additional properties are still allowed).
  • #530 370ed7b Thanks @drwpow! - Soft deprecate core/required-typography-properties in favor of core/valid-typography

  • #530 370ed7b Thanks @drwpow! - ⚠️ Minor breaking change: the transform() API now returns the Momoa node as the 1st parameter. The 2nd parameter is now an object with more context. Lastly, it requires returning a momoa node, rather than raw JSON.

    + import * as momoa from "@humanwhocodes/momoa";
    
      transform: {
    -   color(json, path, node) {
    +   color(node, { path, filename }) {
    +     const json = momoa.evaluate(node);
    -     return json;
    +     return momoa.parse(json);
        }

    This should result in a little less work overall. For example, instead of writing if (typeof json === 'object' && !Array.isArray(json)) that could be shortened to if (node.type === 'Object'), among many other such advantages. You can call evaluate() manually if you’re more used to working with the raw JSON instead. Similarly, you can call parse() if you’re working with

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

  • #530 370ed7b Thanks @drwpow! - Minor breaking change: build() and buildEnd() plugin hooks are now executed in parallel. The other hooks are still executed sequentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: the following token types have more strict requirements about all properties being present:

    • Border
    • Transition
    • Typography

    These behaviors may be opted out individually by adjusting the new lint rules (see documentation).

  • #589 8f32d44 Thanks @michaelurban! - feat: add typography shorthand, improve Sass plugin

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Fix bug where border tokens’ partial aliases would sometimes refer to themselves

  • #530 370ed7b Thanks @drwpow! - Fix bug of lint warning of rules turned off being unused

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #530 370ed7b Thanks @drwpow! - Add first class support for JSON $refs, both remote and local.

    Under-the-hood this transforms DTCG aliases to JSON $refs, so they’re interchangeable.

  • #530 370ed7b Thanks @drwpow! - Bugfix: fix strokeStyle partialAliasOf

  • #530 370ed7b Thanks @drwpow! - Add missing $deprecated property to group types

  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

  • An error is now thrown if --config [path] points to a bad location.

  • TypeScript config files now fully supported! terrazzo.config.ts is now the default.

0.10.3

Patch Changes

0.10.2

Patch Changes

  • #526 085f657 Thanks @drwpow! - Update strokeStyle tokens to allow modern dimension syntax

0.10.1

Patch Changes

  • #510 4493731 Thanks @drwpow! - Reduce decimal places in color output.

    • [plugin-css] ⚠️ Minor breaking change: decimals have been simplified in output. To restore original behavior, pass in colorDepth: 'unlimited'
  • Updated dependencies [4493731]:

0.10.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

Read more

@terrazzo/[email protected]

08 Dec 17:57
d4b958f

Choose a tag to compare

Pre-release

@terrazzo/token-tools

2.0.0

Minor Changes

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change; DTCG 2nd Editors draft format will throw errors by default. This means converting all colors and dimensions to the new object format.

    Though this is a breaking change in default behavior, you can opt back into the old behavior by adjusting your config’s lint settings. See https://terrazzo.app/docs/linting/.

    List of changes:

    • color: channels is invalid; components is required (“channels” was never part of the spec; this just deprecates an in-progress draft that was briefly supported)
    • dimension: object notation ({ value: 16, unit: 'px' }) required.
    • dimension: 0 is no longer automatically expanded to{ value: 0, unit: 'px' }.
    • duration: object notation ({ value: 100, unit: 'ms' }) required.
    • dimension: { $value: 0 } no longer allowed.
    • typography: fontFamily, fontSize, fontWeight, lineHeight, and letterSpacing are all required at a minimum (additional properties are still allowed).
  • #530 370ed7b Thanks @drwpow! - Soft deprecate core/required-typography-properties in favor of core/valid-typography

  • #530 370ed7b Thanks @drwpow! - ⚠️ Minor breaking change: the transform() API now returns the Momoa node as the 1st parameter. The 2nd parameter is now an object with more context. Lastly, it requires returning a momoa node, rather than raw JSON.

    + import * as momoa from "@humanwhocodes/momoa";
    
      transform: {
    -   color(json, path, node) {
    +   color(node, { path, filename }) {
    +     const json = momoa.evaluate(node);
    -     return json;
    +     return momoa.parse(json);
        }

    This should result in a little less work overall. For example, instead of writing if (typeof json === 'object' && !Array.isArray(json)) that could be shortened to if (node.type === 'Object'), among many other such advantages. You can call evaluate() manually if you’re more used to working with the raw JSON instead. Similarly, you can call parse() if you’re working with

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.

    If your lint plugin is not using the src context value, no changes are needed. If it is, you’ll need to instead read from the sources array, and look up sources with a token’s source.loc filename manually. This change was because lint rules now run on all files in one pass, essentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.

  • #530 370ed7b Thanks @drwpow! - Minor breaking change: build() and buildEnd() plugin hooks are now executed in parallel. The other hooks are still executed sequentially.

  • #530 370ed7b Thanks @drwpow! - ⚠️ Breaking change: the following token types have more strict requirements about all properties being present:

    • Border
    • Transition
    • Typography

    These behaviors may be opted out individually by adjusting the new lint rules (see documentation).

Patch Changes

  • #530 370ed7b Thanks @drwpow! - Fix bug where border tokens’ partial aliases would sometimes refer to themselves

  • #530 370ed7b Thanks @drwpow! - Fix bug of lint warning of rules turned off being unused

  • #530 370ed7b Thanks @drwpow! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.

  • #530 370ed7b Thanks @drwpow! - Add first class support for JSON $refs, both remote and local.

    Under-the-hood this transforms DTCG aliase to JSON $refs, so they’re interchangeable.

  • #530 370ed7b Thanks @drwpow! - Bugfix: fix strokeStyle partialAliasOf

  • #530 370ed7b Thanks @drwpow! - Add missing $deprecated property to group types

  • #568 67c75be Thanks @drwpow! - Fix border tokens not cascading correctly across modes

  • #589 8f32d44 Thanks @michaelurban! - feat: add typography shorthand, improve Sass plugin

0.10.3

Patch Changes

0.10.2

Patch Changes

  • #526 085f657 Thanks @drwpow! - Update strokeStyle tokens to allow modern dimension syntax

0.10.1

Patch Changes

  • #510 4493731 Thanks @drwpow! - Reduce decimal places in color output.
    • [plugin-css] ⚠️ Minor breaking change: decimals have been simplified in output. To restore original behavior, pass in colorDepth: 'unlimited'

0.10.0

Minor Changes

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: remove HSV as a supported colorSpace, because it’s absent from CSS Color Module 4

  • #507 0060100 Thanks @drwpow! - ⚠️ Breaking change: align color token ranges to CSS Color Module 4. This results in breaking changes to HSL and HWB, which normalize to 0 - 100, rather than 0 - 1:

      {
        "colorSpace": "hsl",
    -   "components": [270, 0.5, 0.4]
    +   "components": [270, 50, 40]
      }

    All other color spaces should be unaffected, as they were already matching CSS Color Module 4.

Patch Changes

  • #507 0060100 Thanks @drwpow! - Fix a98-rgb colorSpace, accidentally referring to it as "a98"

0.9.1

Patch Changes

  • #502 c9792bd Thanks @drwpow! - Fix bug in parsing LAB colors

  • #502 c9792bd Thanks @drwpow! - Add support for lab65 colors (not technically part of CSS Module 4 spec, but a nice convenience)

0.9.0

Minor Changes

Read more