1.11.3 • Published 11 months ago

@cobalt-ui/core v1.11.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@cobalt-ui/core

Parser/validator for the Design Tokens Community Group (DTCG) standard.

For the CLI, use @cobalt-ui/cli.

Install

npm install @cobalt-ui/core

Usage

Parse a tokens.json file into a JS object

import co from "@cobalt-ui/core";

const designTokens = {
  color: {
    red:   {$type: "color", $value: "#e34850"},
    green: {$type: "color", $value: "#2d9d78"},
    blue:  {$type: "color", $value: "#2680eb"},
  },
};

const {errors, warnings, result} = co.parse(designTokens);
NameTypeDescription
resultToken[]Flattened array of all parsed tokens in the schema (this may be incomplete if errors present)
errorsstring[] | undefinedIf present, unrecoverable errors were encountered (you should probably throw with these messages).
warningsstring[] | undefinedIf present, the parser found schema issues that are likely undesirable, but the schema is still usable (you should probably show the user).
1.11.3

11 months ago

1.11.2

1 year ago

1.11.1

1 year ago

1.10.2

1 year ago

1.11.0

1 year ago

1.10.1

1 year ago

1.10.0

1 year ago

1.9.0

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.3

1 year ago

1.7.2

1 year ago

1.7.0

1 year ago

1.2.0

2 years ago

1.6.1

2 years ago

1.4.3

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.0

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.6.4

3 years ago

0.7.0

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.1.0

3 years ago

0.0.1

4 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.0.2

4 years ago

0.5.0

3 years ago

0.3.2

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.0.0

4 years ago