0.3.7 • Published 1 month ago

@biom3/design-tokens v0.3.7

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 month ago

BIOM3-textured-logos-10

@biom3/design-tokens

This package publishes via CICD to the public npm component: @biom3/design-tokens. To read more, see the theming & tokenisation proposal document.

To see an overview of the entire design-tokens taxonomy, see this document.

What's inside?

Through this component we expose our complete library of BIOME design tokens. They are made available for use as both:

  1. exported typescript consts, and
  2. css variable definitions inside of importable css files

Using the ts const design tokens:

To use the typescript design-tokens, simply import them from the root of the pacakge. For example:

import { base } from '@biom3/design-tokens';

BIOME's default colour scheme is onLight. Therefore, when you import the base, or onLightBase design-tokens, you will get ONLY the onLight colors and gradients.

To use these design-token variables inside bespoke react typescript components:

import {
  onDarkBase,
  onLightBase,
  smartPickTokenValue,
} from '@biom3/design-tokens';
const DemoComponent = () => (
  <div
    style={{
      fontSize: onLightBase.text.body.medium.regular.fontSize,
      color: smartPickTokenValue(onDarkBase, 'base.color.brand.1'),
    }}
  >
    test component text
  </div>
);

Using the css-variable design-tokens:

All the BIOME design-tokens can be imported and used as simple css-variables, by importing css files from your App code. For example:

import '@biom3/design-tokens/css/base-onLight.global.css'; // contains all "onLight" BASE design-tokens
// import "@biom3/design-tokens/css/base-onDark.global.css"; // contains all "onDark" BASE design-tokens
import '@biom3/design-tokens/css/text.global.css'; // contains all fonts (@font-face) imports

*@NOTE All css-variable declarations are global styles scoped to the body selector, thus the base design-token files will overwrite each other, so you should only use 1 base design-token css file at a time. Choose the theme css file based on whether you are planning to display UI in "onDark" or "onLight" (or add your own!).

To see a complete listing of all available design-token css-variables, you can inspect the body element inside your browser's dev tools. For example:

Screenshot 2022-12-07 at 11 32 00 am

Then, to use these css-variable design-tokens:

/* some custom styles.css file: */
@import '@biom3/design-tokens/css/base-onDark.global.css';
@import '@biom3/design-tokens/css/text.global.css';

/* your bespoke item class styles */
.headingText {
  color: var(--base-color-brand-1);
}
0.3.7

1 month ago

0.3.6

2 months ago

0.3.5

2 months ago

0.3.4

3 months ago

0.3.3

3 months ago

0.3.2

3 months ago

0.3.0

3 months ago

0.3.1

3 months ago

0.2.11

4 months ago

0.2.10

4 months ago

0.2.4-beta

9 months ago

0.2.3-beta

9 months ago

0.2.7

7 months ago

0.2.6

7 months ago

0.2.9

7 months ago

0.2.8

7 months ago

0.2.5

8 months ago

0.2.1-beta

11 months ago

0.2.2-beta

11 months ago

0.2.0-beta

12 months ago

0.1.6-beta

12 months ago

0.1.5-beta

1 year ago

0.1.4-beta

1 year ago

0.0.15-alpha

1 year ago

0.1.3-beta

1 year ago

0.0.10-alpha

1 year ago

0.0.11-alpha

1 year ago

0.0.14-alpha

1 year ago

0.0.12-alpha

1 year ago

0.1.0-beta

1 year ago

0.0.13-alpha

1 year ago

0.1.1-beta

1 year ago

0.1.2-beta

1 year ago

0.0.9-alpha

1 year ago

0.0.8-alpha

1 year ago

0.0.7-alpha

1 year ago

0.0.6-alpha

1 year ago

0.0.5-alpha

1 year ago

0.0.4-alpha

1 year ago

0.0.3-alpha

1 year ago

0.0.2-alpha

1 year ago

0.0.1-alpha

1 year ago