1.7.3 • Published 3 months ago

@cobalt-ui/plugin-css v1.7.3

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

@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

1.7.3

3 months ago

1.7.2

3 months ago

1.7.1

3 months ago

1.6.2

6 months ago

1.7.0

5 months ago

1.6.1

6 months ago

1.3.4

8 months ago

1.6.0

6 months ago

1.5.1

7 months ago

1.3.3

8 months ago

1.5.0

8 months ago

1.4.1

8 months ago

1.3.2

9 months ago

1.2.3

10 months ago

1.4.0

8 months ago

1.3.1

9 months ago

1.3.0

10 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

1.1.4

1 year ago

1.1.3

2 years ago

1.1.2

2 years ago

0.8.1

2 years ago

0.8.2

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.1.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.5.2

2 years ago

0.4.3

2 years ago

0.3.4

2 years ago

0.5.1

2 years ago

0.4.2

2 years ago

0.3.3

2 years ago

0.0.0

2 years ago