3.0.7-alpha.0 • Published 5 months ago

@allenai/varnish-theme v3.0.7-alpha.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 months ago

varnish-theme

varnish-theme contains design tokens and basic CSS for AI2's varnish component library.

Using varnish-theme

First, install varnish-theme:

yarn add @allenai/varnish-theme

CSS

You can use the CSS tokens or varnish CSS by importing them into your CSS file by using CSS @import.

If you have the webpack css-loader set up, you can import them this way: For the tokens:

@import '~@allenai/varnish-theme/dist/varnish-tokens.css' layer(varnish);

For the main CSS:

@import '~@allenai/varnish-theme/varnish.css' layer(varnish);

JS

We provide a typed JS file you can import.

import varnishTokens from '@allenai/varnish-theme'

JSON

We provide a JSON file similar to the JS file.

To import it in JS:

import varnishTokens from '@allenai/varnish-theme/varnish-tokens.json'

Simple Hex Unitless

If you want the theme with just the values, hexAlpha colors, and spacing tokens provided in pixels without a number, we provide that as well.

import simpleVarnishTokens from '@allenai/varnish-theme/simple-hex-unitless'

Development

We use (style-dictionary)https://amzn.github.io/style-dictionary/#/ and (style-dictionary-utils)https://github.com/lukasoppermann/style-dictionary-utils to create the exported files.

To add or change tokens, modify .js files in the tokens folder. To update the output with your new tokens, run yarn workspace @allenai/varnish-theme build.

Adding Icons

First, add your svg file under icons folder. Then update tokens/assets/icon.cjs with this filepath. Then run yarn workspace @allenai/varnish-theme build

Updating Figma with varnish-theme tokens

Further instructions here 1. Go to your Figma document 2. Click the Figma button in the top left corner. Go to plugins, and install Tokens Studio for Figma and open it 3. Here you will see a visual representation of your tokens including colors, spacing, etc. Go to the tokens you want to edit and click the {} button in the top right. 4. Here will be an editable JSON file of your tokens. Insert/edit your tokens here. You may need to format your new tokens to be in the same JSON style 5. Click "Save JSON" 6. Message your designer that you updated the tokens in Figma. Done!

3.0.3-alpha.0

6 months ago

3.0.4-alpha.0

6 months ago

3.0.5-alpha.0

5 months ago

3.0.0-alpha.0

10 months ago

3.0.2-alpha.0

8 months ago

3.0.2-alpha.1

8 months ago

3.0.1-alpha.0

8 months ago

3.0.7-alpha.0

5 months ago

3.0.0

8 months ago

3.0.6-alpha.0

5 months ago

2.0.6

12 months ago

2.0.3-beta.0

1 year ago

2.0.5

1 year ago

2.0.2-beta.0

1 year ago

1.2.2-beta.0

1 year ago

1.2.3-beta.0

1 year ago

1.2.1

1 year ago

2.0.1-beta.0

1 year ago

2.0.0-beta.0

1 year ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.14

2 years ago

0.0.8-alpha.0

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago