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

1.8.1 • Public • Published

@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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.8.168latest

Version History

VersionDownloads (Last 7 Days)Published
1.8.168
1.8.00
1.7.175
1.3.30
1.3.20
1.3.10
1.3.033
1.2.50
1.2.40
1.2.30
1.2.20
1.2.00
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.00
0.7.20
0.7.10
0.7.00
0.6.20
0.6.10
0.6.00
0.5.01
0.4.90
0.4.80
0.4.70
0.4.61
0.4.50
0.4.40
0.4.30
0.4.20
0.4.10
0.4.00
0.3.20
0.3.10
0.3.01
0.2.10
0.2.00
0.1.00
0.0.00

Package Sidebar

Install

npm i @cobalt-ui/plugin-sass

Weekly Downloads

179

Version

1.8.1

License

MIT

Unpacked Size

60.1 kB

Total Files

15

Last publish

Collaborators

  • drewpowers