1.0.9 • Published 1 year ago

design-tokens-to-scss v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

designTokens2SCSS

Overview

This package provides a method to generate scss palette and variables directly from the design tokens direactory. The design tokens files should be JSON files containing descriptions of colors, sizes, etc., as in the exapmles

/* tokens/dark/color/background.json */
{
  "100": { "value": "#cacbcc33" },
  "200": { "value": "#cacbcc77" },
  "300": { "value": "#cacbccaa" },
  "400": { "value": "#cacbccdd" }
}
/* size/base.json */
{
  "100": { "value": "1rem" },
  "200": { "value": "1.5rem" },
  "300": { "value": "2rem" }
}

It provides the method processTokens.

Config

The processTokens method requires an config object containg the tokens source path, the target path and content array of elements to generate: 'palette' and 'variables':

/* config object */
{
  "source": "./tokens",
  "target": "./target",
  "content": ["palette", "variables"]
}

Defaut value for content is ["palette", "variables"].

Tokens

An example of tokens can be found in the package tokens directory.

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago