Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@ui-js/chromatic
Advanced tools
A build system for managing cross-platform design systems using design tokens.
A tool to help manage design systems by generating platform-specific files from a source file describing design tokens.
Tokens can contain rich expressions in a natural syntax, including arithmetic
operations, units (12px
), function (rgb()
, mix()
, saturate()
...) and
references to other tokens.
tokens:
primary-hue: '210deg'
primary: 'hsl({primary-hue}, 100%, 40%)'
primary-dark: 'darken({primary}, 20%)'
line-height: '18pt + 5px'
Each token can have a theme variant, such as dark/light, or compact/cozy layouts. The necessary output artifacts are generated automatically.
tokens:
cta-button-background:
value:
dark: '#004082'
light: '#0066ce'
Get going quickly. A simple token file written YAML or JSON file is all you need.
But Chromatic is also customizable when you need to. You can write or modify the format of the output files to suit your needs.
Chromatic is also available as an API that can be invoked from a build system.
From a single token file, generate platform specific artifacts:
Chromatic can also generate a style guide as a HTML file.
$ npm install -g @arnog/chromatic
To create a directory with an example:
$ chromatic example ./test
$ chromatic ./test -o tokens.scss
$ chromatic ./test -o tokens.html
Or writing your own token file:
# tokens.yaml
tokens:
background: '#f1f1f1'
body-color: '#333'
$ chromatic tokens.yaml -o tokens.scss
$background: #f1f1f1 !default;
$body-color: #333 !default;
Now, let's create a dark theme:
# tokens-dark.yaml
theme: dark
tokens:
background: '#222'
body-color: '#a0a0a0'
# tokens.yaml
import: ./tokens-dark.yaml
tokens:
background: '#f1f1f1'
body-color: '#333'
$ chromatic tokens.yaml -o tokens.scss
:root {
--background: #f1f1f1;
--body-color: #333;
}
body[data-theme='dark'] {
--background: #222;
--body-color: #a0a0a0;
}
FAQs
A build system for managing cross-platform design systems using design tokens.
The npm package @ui-js/chromatic receives a total of 7 weekly downloads. As such, @ui-js/chromatic popularity was classified as not popular.
We found that @ui-js/chromatic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.