1.11.1 • Published 24 days ago

@cobalt-ui/core v1.11.1

Weekly downloads
-
License
MIT
Repository
github
Last release
24 days 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.1

24 days ago

1.10.2

1 month ago

1.11.0

1 month ago

1.10.1

1 month ago

1.10.0

1 month ago

1.9.0

1 month ago

1.8.1

2 months ago

1.8.0

2 months ago

1.7.3

2 months ago

1.7.2

2 months ago

1.7.0

3 months ago

1.2.0

10 months ago

1.6.1

6 months ago

1.4.3

8 months ago

1.6.0

8 months ago

1.5.0

8 months ago

1.4.0

9 months ago

1.3.1

9 months ago

1.3.0

10 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.0.0

1 year ago

0.7.4

1 year ago

0.7.3

1 year ago

0.7.2

1 year ago

0.7.1

2 years ago

0.6.4

2 years ago

0.7.0

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.0.2

2 years ago

0.5.0

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.0.0

2 years ago