npm.io
0.0.23 • Published 4 years ago

@real-system/theme-library

Licence
MIT
Version
0.0.23
Deps
0
Size
201 kB
Vulns
0
Weekly
0
Stars
4

@real-system/theme-library

Real System's theming components and helpers.

npm version

Usage

Installation

# install peer dependencies

# npm
$ npm install --save @real-system/styling-library react react-dom
# yarn
$ yarn add @real-system/styling-library react react-dom

# install theme

# npm
$ npm install --save @real-system/theme-library
# yarn
$ yarn add @real-system/theme-library
Code Example
import { ThemeProvider, useTokens } from '@real-system/theme-library';

const OtherComponent = () => {
  const [bgColor, textColor] = useToken({
    colors: 'white',
    colors: 'gray-500'
  });
  return (
    <div style={{ backgroundColor: bgColor, color: textColor }}>...</div>
  );
};

const MyComponent = () => {
  return (
    <ThemeProvider>
      <OtherComponent />
    </ThemeProvider>
  );
};

Keywords