Skip to content

Commit

Permalink
docs: update readme to show SCSS and CSS usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-ludwig committed Nov 24, 2021
1 parent d90da05 commit 8e44694
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions @kiva/kv-tokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,42 @@ The package contains

## Using the Design Definitions

### With JavaScript

```js
const designTokens = require("@kiva/kv-tokens/primitives.json");

const primaryTextColor = designTokens.colors.theme.DEFAULT.text.primary.value;
```

### With SCSS

```scss
@import "./node_modules/@kiva/kv-tokens/dist/scss/_variables";

body {
background-color: $colors-theme-default-background-primary;
color: $colors-theme-default-text-primary;
font-size: #{$font-sizes-base-lg}px;
}
```

### With CSS Custom Properties

```html
<link
rel="stylesheet"
href="./node_modules/@kiva/kv-tokens/dist/css/variables.css"
/>
<style>
body {
background-color: var(--colors-theme-default-background-primary);
color: var(--colors-theme-default-text-primary);
font-size: calc(var(--font-sizes-base-lg) * 1px);
}
</style>
```

## Using the Tailwind Preset

```js
Expand Down

0 comments on commit 8e44694

Please sign in to comment.