# kubas

> A design token and utility class generator

Latest version **0.6.0** (published 2021-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install kubas
pnpm add kubas
yarn add kubas
bun add kubas
```

Provides the command `kubas`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2021-06-02 |
| First published | 2020-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Galbraith |
| Maintainers | underscores |

## Links

- npm: https://www.npmjs.com/package/kubas
- Repository: https://github.com/chrismademe/kubas
- Homepage: https://github.com/chrismademe/kubas#readme
- Issues: https://github.com/chrismademe/kubas/issues
- npm.io page: https://npm.io/package/kubas

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [prettier](https://npm.io/package/prettier.md) ^2.0.5
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^6.0.0

## Recent versions

- 0.6.0 (latest) — 2021-06-02
- 0.5.0 — 2021-06-02
- 0.4.0 — 2021-06-02
- 0.3.0 — 2021-01-28
- 0.2.0 — 2020-05-29
- 0.1.3 — 2020-05-29
- 0.1.2 — 2020-05-29
- 0.1.1 — 2020-05-29
- 0.1.0 — 2020-05-29

## README

# Kubas

Kubas takes design tokens and generates CSS Custom Properties and Utility Classes for them. The output is 2 CSS files, `tokens.css` and `utilities.css`.

The name is the Lithuanian translation of Cube - [CUBE CSS](https://piccalil.li/blog/cube-css/) is a term coined by Andy Bell and the idea behind it inspired this tool. He also has a similar tool called [Goron](https://github.com/hankchizljaw/goron) which is probably better than this, but I wanted to build something :)

## Installation

```javascript
npm install kubas --save
```

## Defining Tokens

Config can be done in JSON or JS. Create a `kubas.json` or `kubas.config.js` in your project directory. If you choose JS, it'll need to export an object containing your config.

By default, the `outputDir` key is set to `dist`, so set this to suit your project.

Your config should contain 2 objects, one to define your `tokens` and another to map those tokens to `utilities`. In the example below, we color tokens, which are mapped to `c-*` utility classes, which will set `color` to each of the available color tokens.

```javascript
module.exports = {
    outputDir: 'src/css',
    tokens: {
        color: {
            black: '#000',
            white: '#fff',
        },
    },
    utilities: {
        color: {
            c: 'color',
        },
    },
};
```

There's no support for breakpoints at the moment and I don't know if there ever will be. That sorta defeats the idea of the simplistic nature of CUBE CSS.

### Generate CSS

Run Kubas from your command line. To use the `kubas` alias, you'll need to install Kubas globally. (`npm install kubas -g`)

```bash
kubas
```

## Roadmap

-   Write tests
-   Add support for utility classes that aren't mapped directly to tokens

---
_Source: https://npm.io/package/kubas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
