@real-system/theme-library
v0.0.23
Published
theming for real system
Downloads
37
Maintainers
Readme
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-libraryCode 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>
);
};
