Last active
March 27, 2019 11:56
-
-
Save technology-amazeelabs/320f68aefb44cd49b108958a415a93c2 to your computer and use it in GitHub Desktop.
CSS-in-JS example #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { apiFunc } from 'some-css-in-js-project'; | |
const styles = { | |
base: { | |
color: '#fff', | |
':hover': { | |
backgroundColor: '#0074d9', | |
}, | |
}, | |
primary: { | |
backgroundColor: '#0074D9' | |
}, | |
warning: { | |
'background-color': someValueReturnedByAFunction(), | |
}, | |
}; | |
export const MyComponent = () => ( | |
<div className={apiFunc(styles.base, styles.warning)}> | |
Some content | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment