Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jaalah committed Apr 19, 2024
1 parent cedba7e commit bfd381c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,24 @@ This shows a few things happening:
1. The build system does a deep merge of all the token JSON files defined in the `source` attribute of `config/build.ts`. This allows you to split up the token JSON files however you want.
2. The build system resolves references to other design tokens in other files as well. For example in `tokens/alias/light.json` the value `{color.neutrals.white}` gets resolved properly.

## Usage in Apps
## Example Usage in Apps

Example:
You may import each tier of tokens: `Global, Alias, Component`
```
import { Global, Alias, Component } from '@linode/design-language-system';
```

You may alternately access any token set under each tier:
```
import { Color, Interaction, Button } from '@linode/design-language-system';
```
import { Aliases, Components, Globals } from '@linode/design-language-system';

const { Color } = Globals;
const { Border, Interaction } = Aliases;
const { Button } = Components;
You selectively import tokens by extending the path:
```
import { Button } from '@linode/design-language-system/components';
```

All of the above applies to themes:
```
import { Global, Alias, Component } from '@linode/design-language-system/themes/dark';
```

0 comments on commit bfd381c

Please sign in to comment.