0.13.2 • Published 20 days ago

@availity/design-tokens v0.13.2

Weekly downloads
-
License
-
Repository
-
Last release
20 days ago

Availity Design Tokens

This repo contains design tokens for the Availity Design System, Element. The tokens are created with Figma and then converted to several consumable formats with Style Dictionary. The formats are:

  • ES6 modules for CSS-in-JS approach (styled-components/emotion)
  • CSS variables for applications using class based CSS approach
  • SCSS variables for scss integration using a global stylesheet

Installation

NPM

npm install @availity/design-tokens

Yarn

yarn add @availity/design-tokens

Usage

This package can be consumed in three different ways: css, scss, or js

CSS

Import the css file to your app

import '@availity/design-tokens/css/variables.css';

SCSS

Import the scss file to your app

import '@availity/design-tokens/scss/variables.scss';

JavaScript

Import the theme object to use in your app. In this example we create a material theme to be used with the theme provider

import { lightTheme } from '@availity/design-tokens';
import { ThemeProvider, createTheme } from '@mui/material/styles';

const defaultTheme = createTheme(lightTheme);

const App = () => {
  return (
    <MuiThemeProvider theme={theme}>
      <SampleComponents />
    </MuiThemeProvider>
  );
};

How it works

  1. The tokens are first created in Figma. The tokens.json file is generated by Figma and added to the repo via pull-request.

  2. The transform script, which uses token-transformer, converts the tokens.json file to a format style-dictionary can use. The output is core.json.

  3. The newly created core.json is then used by style-dictionary to output consumable forms of the tokens. These include css, scss, and js. There is a build-script which handles this conversion. This script uses config.json to determine how the transformation is handled.

  4. Now the theme object is created using the tokens in the generated tokens.js file. Currently, only a light-theme exists. This object is exported for apps to use.

  5. The files are compiled using TypeScript and output in the dist folder where they are ready to be published.

0.13.2

20 days ago

0.13.1

4 months ago

0.13.0

4 months ago

0.12.2

5 months ago

0.12.1

5 months ago

0.11.0

6 months ago

0.11.1

6 months ago

0.12.0

6 months ago

0.10.0

6 months ago

0.4.9

9 months ago

0.4.8

9 months ago

0.9.0

7 months ago

0.7.1

7 months ago

0.5.0

9 months ago

0.7.0

7 months ago

0.5.1

9 months ago

0.4.10

9 months ago

0.8.0

7 months ago

0.6.2

8 months ago

0.4.7

9 months ago

0.6.1

8 months ago

0.6.0

9 months ago

0.4.6

12 months ago

0.4.1-alpha.0

1 year ago

0.4.5

1 year ago

0.4.4

1 year ago

0.4.1

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.5.0-alpha.0

1 year ago

0.3.13

1 year ago

0.3.11

1 year ago

0.3.9

2 years ago

0.3.10

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.1.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.8

2 years ago

0.3.5

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.3.2

2 years ago

0.2.3

2 years ago

0.1.4

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.1.3

2 years ago

0.3.4

2 years ago

0.1.6

2 years ago

0.3.3

2 years ago

0.2.4

2 years ago

0.1.5

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago