1.8.0 • Published 3 months ago

@cobalt-ui/plugin-sass v1.8.0

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

@cobalt-ui/plugin-sass

Generate .scss and .sass from your Design Tokens Community Group (DTCG) tokens.

Features

  • ✅ Supports all features of the CSS plugin
  • ✅ Strong typechecking with Sass to never have broken styles

Setup

Install the plugin (and its dependency) from npm:

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

Then add to your tokens.config.mjs file:

// tokens.config.mjs
import pluginSass from '@cobalt-ui/plugin-sass';

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

And run:

npx co build

You’ll then generate a ./tokens/index.scss file that exports a token() function you can use to grab tokens:

@use '../tokens' as *; // update '../tokens' to match your location of tokens/index.scss

.heading {
  color: token('color.blue');
  font-size: token('typography.size.xxl');
}

Docs

View the full documentation

1.8.0

3 months ago

1.7.1

4 months ago

1.2.5

9 months ago

1.3.3

6 months ago

1.2.4

9 months ago

1.3.2

7 months ago

1.2.3

10 months ago

1.3.1

7 months ago

1.3.0

8 months ago

1.2.2

11 months ago

1.2.1

12 months ago

1.2.0

1 year ago

1.1.4

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.9

2 years ago

0.4.8

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.5

2 years ago

0.4.4

2 years ago

0.4.7

2 years ago

0.4.6

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.4.3

2 years ago

0.4.2

2 years ago

0.0.0

2 years ago