4.0.2 • Published 4 years ago

@ifsworld/ifs-design-tokens v4.0.2

Weekly downloads
86
License
-
Repository
-
Last release
4 years ago

IFS Design Tokens - README

Design Tokens are a way of storing design decisions. To ensure consistency. The entities are in the shape of key-value pairs. Each entity representing a design element - a color, a spacing, a font, or even a font-size.

npm version

Example - Token representing a color

alt text

Web

Both static and run time resources are provided.

TypeFile type
StaticSCSS*
Run timeTypescript (JSON)

*Initially, only SCSS format is provided (not css or less).

How to use

The designated default theme has to be imported as SCSS. The default theme refers to CSS variables that are updated in run time with the help of the IFS Token Manager.

Within your application, the DOM root element will make css variables available.

Theme and Color

Three core themes are made available - light, dark, and high contrast. A theme is commonly limited to color choices, but may also include tokens for any other style property.

alt text

SCSS

By importing the SCSS, token variables will automatically be made available within :root. In this example, we import the light theme. It will then be considered as the default theme.

@import '@ifsworld/ifs-design-tokens/build/web/light/tokens';

If it turns out that you also need to interact with the tokens in scss compilation, include them as scss variables.

@import '@ifsworld/ifs-design-tokens/build/web/light/variables';
Using a theme token
// Direct usage for modern browsers
background-color: var(--fnd-css-variable);
Token supported browsers

To support older browsers that do not support CSS variables, the fallback value parameter is required. For these scenarios, parse out values from the provided stylesheet, or use your own fallback values.

CanIUse

Typically, a SCSS map structure would be provided, with the design tokens, to cover such a scenario. We have however deemed that this will not be necessary in the future, as all browsers worthy of supporting, shouldn't need any fallback value, as they fully support CSS variables.

Typescript
@import { themeTokenManager } from '@ifsworld/ifs-design-tokens';
JavaScript
const themeTokenManager = require('@ifsworld/ifs-design-tokens');

White-label

Whitelabelling (enabling users to change certain design elements) is managed by overriding CSS variable values. In the future, these values will be carefully chosen by designers, to blend in well with the rest of the user interface. Color values for example may be representative of a certain company or user.

Contribute

Visit project's Development Guidelines for instructions.

4.0.5-beta.1

4 years ago

4.0.3-beta.1

4 years ago

4.0.5-beta.2

4 years ago

4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.2.0

4 years ago

3.0.0

4 years ago

3.1.0-beta.1

4 years ago

3.1.0-beta.2

4 years ago

3.1.0

4 years ago

2.0.2

4 years ago

2.0.1-beta.1

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

3.0.0-beta.1

4 years ago

2.0.2-beta.1

4 years ago

2.0.0-beta.1

4 years ago

1.5.0

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.5.0-beta.1

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.3.0-beta.1

4 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.2.0-beta.2

5 years ago

1.2.0-beta.1

5 years ago

1.1.25

5 years ago

1.1.24

5 years ago

1.1.23

5 years ago

1.1.19

5 years ago

1.1.22

5 years ago

1.1.21

5 years ago

1.1.18

5 years ago

1.1.16

5 years ago

1.1.17

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago