2.0.0 • Published 6 years ago

@rapharacing/design-tokens v2.0.0

Weekly downloads
44
License
MIT
Repository
github
Last release
6 years ago

Rapha Design Tokens

MIT License

Design tokens are the visual design atoms of the design system — specifically, they are named entities that store visual design attributes. We use them in place of hard-coded values (such as hex values for color or pixel values for spacing) in order to maintain a scalable and consistent visual system for UI development – Salesforce UX

Installation

Using npm:

npm i @rapharacing/design-tokens --save

Using Yarn:

yarn add @rapharacing/design-tokens

How to use

JavaScript

If the project supports ECMAScript Modules, you can use the import syntax

import * as tokens from "@rapharacing/design-tokens";

console.log(tokens.colorPink); // hsl(343, 88%, 71%)

otherwise

const tokens = require('@rapharacing/design-tokens');

console.log(tokens.colorPink); // hsl(343, 88%, 71%)

In JSON, design token names are formatted in kebab-case.

const tokens = require('@rapharacing/design-tokens/dist/index.json');

console.log(tokens['color-pink']); // hsl(343, 88%, 71%)

Sass

Sass variables are formatted in kebab-case.

// Using variables
@import '~@rapharacing/design-tokens/dist/index';

a {
  color: $color-pink;
}

License

Design tokens are freely distributable under the terms of the MIT license.

2.0.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago