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

Package detail

@cobalt-ui/cli

terrazzoapp5.4kMIT1.12.0TypeScript support: included

CLI for managing design tokens using the Design Tokens Community Group (DTCG) standard and generating code for any platform via plugins.

design tokens, design tokens community group, design tokens format module, dtcg, cli, w3c design tokens, design system, typescript, sass, css, style tokens, style system

readme

Cobalt UI

CLI for managing Design Tokens Community Group (DTCG) token manifests (tokens.json) and generating code for any platform via plugins.

Usage

Install:

npm i -D @cobalt-ui/cli

And place a tokens.config.mjs file in the root of your project. Here are all the options, along with defaults:

// tokens.config.mjs

/** @type {import("@cobalt-ui/core").Config} */
export default {
  /** path to tokens.json */
  tokens: "./tokens.json",
  /** output directory for generated code*/
  outDir: "./tokens/",
  /** plugins to generate different outputs */
  plugins: [],
};

Commands

All CLI commands require a config to work properly, with the exception of co check and co convert.

npx co [command]

Command Notes
build Turn design tokens into output files using [plugins]((https://cobalt-ui.pages.dev/docs//integrations). You can watch for changes in dev mode with build --watch.
bundle --out [path] Bundle multiple tokens.json files into one, e.g. co bundle --out path/to/output.json. Can output .json or .yaml. Requires multiple schemas set in config
check [path] Validate a tokens.json file and check for errors. This won’t output any files.
init Create a starter tokens.json file.
convert [path] --out [path] Convert a Style Dictionary JSON file to DTCG (docs)

Plugins

Plugins are the entire purpose of using Cobalt! See the plugin documentation for instructions on getting started.

Documentation

See Documentation

changelog

@cobalt-ui/cli

1.12.0

Minor Changes

  • #352 Thanks @drwpow! - Remove APCA contrast algorithm

1.11.3

Patch Changes

  • Aliases don’t need $types

1.11.2

Patch Changes

1.11.0

Minor Changes

Patch Changes

1.10.2

Patch Changes

1.10.0

Patch Changes

1.8.1

Patch Changes

1.8.0

Minor Changes

Patch Changes

1.7.1

Patch Changes

1.7.0

Minor Changes

Patch Changes

1.6.2

Patch Changes

1.6.1

Patch Changes

1.6.0

Minor Changes

  • #119 1a76946 Thanks @drwpow! - Breaking change: don’t automatically convert colors to hex

Patch Changes

1.5.0

Minor Changes

1.4.2

Patch Changes

1.4.1

Patch Changes

1.4.0

Minor Changes

Patch Changes

1.3.1

Patch Changes

1.3.0

Minor Changes

Patch Changes

1.2.0

Minor Changes

Patch Changes

1.1.3

Patch Changes

1.1.2

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

  • #30 482f5cd Thanks @drwpow! - Deprecate Figma sync CLI and core functionality (in favor of Tokens Studio support)

  • #30 482f5cd Thanks @drwpow! - Add Tokens Studio support

Patch Changes

1.0.0

1.0 Release! 🎉 While the only significant change from 0.x to 1.x is the changing of a few font types, this is more of a symbolic release than an actual semver one. The original plan was to wait to release 1.0 when the W3C Design Token spec was finalized. But who knows when that will be? And so this just marks a journey into building a more stable design token foundation, wherever the current spec is at.

Proper semver will still be respected, so while some spec changes are non-breaking, any breaking change from now on will get proper major bumps for everything.

Minor Changes

  • 526777f: Add fontFamily, fontWeight, fontName, and number types, remove font type

Patch Changes

0.7.4

Patch Changes

0.7.3

Patch Changes

0.7.2

Patch Changes

  • 42401cd: Improve tokens resolution

0.7.1

Patch Changes

  • 3032442: Update undici

0.7.0

Minor Changes

  • e50c864: Add strokeStyle and border support in plugins, improve validation in core

Patch Changes

0.6.2

Patch Changes

0.6.1

Patch Changes

  • 6511100: Fix watch bug

0.6.0

Minor Changes

  • 160200f: co build --watch now detects config changes

0.5.2

Patch Changes

0.5.1

Patch Changes

0.5.0

Minor Changes

  • 07bc365: Update to Feb 2022 version of the Design Tokens format

Patch Changes

0.4.0

Minor Changes

  • 61a7892: Add ability to load JSON from npm package

Patch Changes

0.3.11

Patch Changes

  • 7b04356: Allow free placement of plugin output files

0.3.10

Patch Changes

  • 6ca4403: Fix cobalt check requiring config

0.3.9

Patch Changes

  • 6d70a16: Fix build --watch error

0.3.8

Patch Changes

0.3.7

Patch Changes

0.3.6

Patch Changes

0.3.5

Patch Changes

0.3.4

Patch Changes

  • Bump @cobalt-ui/core version

0.3.3

Patch Changes

  • d5ffc09: Fix co check command

0.3.2

Patch Changes

  • 395e388: Fix figma font style

0.3.1

Patch Changes

  • 4b9da94: Fix co init

0.3.0

Minor Changes

  • 8d05fe8: Add Figma sync, make some breaking API changes

Patch Changes

0.2.1

Patch Changes

  • 6feabd5: Fix build bug

0.2.0

Minor Changes

  • 26bfb4c: Convert to JSON, follow design tokens spec

Patch Changes

0.1.0

Minor Changes

  • 5748e72: Use JSON to align with the Design Tokens W3C spec

Patch Changes

0.0.2

Patch Changes

0.0.1

Patch Changes