@cobalt-ui/plugin-css
TypeScript icon, indicating that this package has built-in type declarations

1.7.5 • Public • Published

@cobalt-ui/plugin-css

Generate CSS from your design tokens using Cobalt.

Features

  • ✅ 🌈 Automatic P3 color enhancement
  • ✅ Automatic mode inheritance (e.g. light/dark mode)

Basic Setup

Install the plugin from npm:

npm i -D @cobalt-ui/plugin-css

Then add to your tokens.config.mjs file:

// tokens.config.mjs
import pluginCSS from "@cobalt-ui/plugin-css";

/** @type {import("@cobalt-ui/core").Config} */
export default {
  tokens: "./tokens.json",
  outDir: "./tokens/",
  plugins: [pluginCSS()],
};

And run:

npx co build

You’ll then get a ./tokens/tokens.css file with CSS variables for you to use anywhere in your app:

/* tokens/tokens.css */

:root {
  --color-blue: #0969da;
  --color-green: #2da44e;
  --color-red: #cf222e;
  --color-black: #101010;
  --color-ui-text: var(--color-black);
}

Docs

View the full documentation

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.7.5312latest

Version History

VersionDownloads (Last 7 Days)Published
1.7.5312
1.7.441
1.7.385
1.7.20
1.7.10
1.7.031
1.6.2181
1.6.10
1.6.00
1.5.10
1.5.06,149
1.4.10
1.4.00
1.3.40
1.3.30
1.3.20
1.3.10
1.3.00
1.2.31
1.2.20
1.2.00
1.1.60
1.1.50
1.1.40
1.1.30
1.1.21
1.1.10
1.1.01
1.0.00
0.8.20
0.8.10
0.8.00
0.7.00
0.6.00
0.5.20
0.5.10
0.4.30
0.4.20
0.4.10
0.4.00
0.3.40
0.3.30
0.3.20
0.3.10
0.3.00
0.2.10
0.2.00
0.1.00
0.0.00

Package Sidebar

Install

npm i @cobalt-ui/plugin-css

Weekly Downloads

6,802

Version

1.7.5

License

MIT

Unpacked Size

137 kB

Total Files

67

Last publish

Collaborators

  • drewpowers