Last active
March 27, 2019 11:56
-
-
Save technology-amazeelabs/6466462419b05a3cc54f24a2485573ae to your computer and use it in GitHub Desktop.
CSS-in-JS example #3
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 { css } from 'some-css-in-js-project'; | |
const styles = css` | |
.base: { | |
color: #fff; | |
&:hover { | |
background-color: #0074d9; | |
} | |
} | |
.primary: { | |
background-color: #0074D9; | |
} | |
.warning: { | |
background-color: ${someValueReturnedByAFunction()}, | |
} | |
`; | |
export const MyComponent = () => ( | |
<div className={`${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