react-st-components
styled components for react
Install
NPM
$ npm install react-st-components --save
Usage
;; const App = { return <> <GlobalStyle /> <STContainer> /* Rest of your code */ </STContainer> </> } ReactDOM
Adding Theme
Wrap your application or selected parts with <STThemeProvider />
for it to pass down the themes.
;; //for theme provider;; const App = { return <> <STThemeProvider theme=theme> <Header /> <Contents /> </STThemeProvider> </> } ReactDOM
The theme
prop of the <STThemeProvider />
must be an object with this structure:
const theme = tones: primary: ''; secondary: ''; success: ''; danger: ''; warning: '' flat: true
- tones - [Object] containing the theme color palette(optional).
- tones. - [String]
hex
color code(optional).
- tones. - [String]
- flat - [Boolean] if set to
true
, allborder-radius
of styled components is set to0px
(optional, defaults to false).
See Docs for more styled components.