53.1.1 • Published 9 days ago

@coveord/plasma-tokens v53.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 days ago

@coveord/plasma-tokens

Design tokens of the Plasma Design System extracted from Figma.

What is a design token?

Simply put, a design token is a stored design decision. It can be understood as a variable that holds the result of a choice (in this case made in Figma). Decisions can be made about multiple different subjects, for example colors, typography, spacing, etc. Therefore, it is important to consider that design tokens come in as many types as there are design subjects.

Objective of this package

Distribute design tokens to all Coveo products that rely on the Plasma Design System through code.

Installation

npm install @coveord/plasma-tokens

For TypeScript users: the package provides its own type declarations.

Usage

Tokens are provided through multiple outputs. Choose the format that best suits your needs.

TypeScript

import * as PlasmaTokens from '@coveord/plasma-tokens';

PlasmaTokens.color.primary.actionBlue[6]; // '#1372ec'

Sass

@import '~@coveord/plasma-tokens/scss';
// or individual libraries
@import '~@coveord/plasma-tokens/scss/Colors';

.something {
    background-color: $plasma-color-primary-action-blue-6;
}

CSS

First include the css file you want tokens from in your page.

<link href="/node_modules/@coveord/plasma-tokens/css/Colors.css" rel="stylesheet" />

Tokens in CSS are exposed as CSS variables.

.something {
    background-color: var(--plasma-color-primary-action-blue-6);
}

Icons

All icons are located under the icons folder in .svg format.

If you want to use icons in a React application, refer to @coveord/plasma-react-icons.

Internal usage

tokens:fetch

Fetches tokens information from our tokens libraries in Figma and outputs the result in JSON format into the data folder.

In order to fetch data from our Figma libraries on your local machine, you will need to create a .env file for yourself that provides the necessary information for the script to run. The file .env.example will help you know where to get the proper values such as the access token.

--libraries, -l

Optional option. Use to target one or more specific tokens libraries. If not specified, all libraries will be fetched. See the list of available libraries.

example:

tokens:fetch --libraries Lib1 Lib2

tokens:build

Translates the fetched tokens into all the available output formats.

tokens:lint

Runs Prettier on the source files generated by the tokens:build command.

This command is automatically run along with the tokens:build command.

build

Builds from the sources files that were generated by the tokens:build command the code to be distributed on NPM (creates the dist folder).

Available token libraries

Library NameAvailable FormatsDescription
Iconssvg, typescriptxml markup of the svg elements of all the icons and their variants.
Colorstypescript, scss, cssValues of the different palettes used throughout plasma, also contains gradients.
53.1.4-next.0

9 days ago

53.1.1

26 days ago

53.1.0

28 days ago

53.0.0

1 month ago

52.27.2-next.12

1 month ago

52.27.4

2 months ago

52.27.2-next.3

2 months ago

52.23.1

7 months ago

52.12.0

10 months ago

52.12.1

10 months ago

52.16.0

9 months ago

52.13.0

10 months ago

52.13.1

10 months ago

52.13.2

10 months ago

52.21.0

7 months ago

52.14.0

10 months ago

52.14.1

9 months ago

52.15.0

9 months ago

52.11.1

11 months ago

52.11.0

11 months ago

52.10.1

11 months ago

52.6.0

12 months ago

52.9.0

11 months ago

52.5.0

1 year ago

52.4.3

1 year ago

52.4.0

1 year ago

52.4.2

1 year ago

52.7.0

12 months ago

52.3.1

1 year ago

52.0.0

1 year ago

49.4.0

1 year ago

49.3.6

1 year ago

49.6.4

1 year ago

49.5.3

1 year ago

50.0.2

1 year ago

47.0.1-next.2

2 years ago

48.25.0

1 year ago

48.17.4

1 year ago

48.24.0

1 year ago

47.0.1-next.1

2 years ago

47.3.7

2 years ago

47.0.1-next.0

2 years ago

47.2.3

2 years ago

46.0.2-next.0

2 years ago

46.0.2-next.3

2 years ago

47.0.0

2 years ago

47.1.0

2 years ago

45.4.0

2 years ago

45.3.0

2 years ago

42.7.0

2 years ago

42.9.0

2 years ago

41.5.1-next.4

2 years ago

42.5.0

2 years ago

42.1.5-next.0

2 years ago

41.3.0

2 years ago

41.2.11

2 years ago

41.5.1-next.5

2 years ago

40.2.0

2 years ago

40.4.32

2 years ago

40.4.17

2 years ago

41.2.8

2 years ago

41.2.5

2 years ago

41.2.9

2 years ago

41.2.4

2 years ago

41.2.3

2 years ago

40.4.14

2 years ago

40.4.11

2 years ago

38.15.10

2 years ago

38.12.0

2 years ago

38.0.5

2 years ago

38.0.4

2 years ago

38.0.3

2 years ago

38.0.2

2 years ago

38.0.1

2 years ago

38.0.0

2 years ago

37.5.0

2 years ago

37.4.2

2 years ago

37.4.1

2 years ago

37.4.0

2 years ago

37.3.0

2 years ago

37.2.0

2 years ago

37.1.4

2 years ago

37.1.3

2 years ago

37.1.2

2 years ago

37.1.1

2 years ago

37.1.0

2 years ago

37.0.3

2 years ago

37.0.2

2 years ago

37.0.1

2 years ago

37.0.0

2 years ago

36.0.0

2 years ago

35.2.0

2 years ago

35.1.1

2 years ago

35.1.0

2 years ago

35.0.0

2 years ago

34.1.4

2 years ago

34.1.3

2 years ago

34.1.2

2 years ago

34.1.1

2 years ago

34.1.0

2 years ago

34.0.0

2 years ago

33.0.0

2 years ago

32.6.0

2 years ago

32.5.0

2 years ago

32.4.2

2 years ago

32.4.1

2 years ago

32.4.0

2 years ago

32.3.1

2 years ago

32.3.0

2 years ago

32.2.1

2 years ago

32.2.0

2 years ago

32.1.2

2 years ago

32.1.1

2 years ago

32.1.0

2 years ago

32.0.0

2 years ago

31.15.0

2 years ago

31.14.0

2 years ago

31.13.0

2 years ago

31.12.0

2 years ago

31.11.2

2 years ago

31.11.1

2 years ago

31.11.0

2 years ago

31.10.1

2 years ago

31.10.0

2 years ago

31.9.1

2 years ago

31.9.0

2 years ago

31.8.5

2 years ago

31.8.4

2 years ago

31.8.3

2 years ago

31.8.2

2 years ago

31.8.1

2 years ago

31.8.0

2 years ago

31.7.0

2 years ago

31.6.1

2 years ago

31.6.0

2 years ago

31.5.2

2 years ago

31.5.1

2 years ago

31.5.0

2 years ago

31.4.0

2 years ago