@real-system/theme-library
Real System's theming components and helpers.
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>
);
};