Last active
March 27, 2019 11:56
-
-
Save technology-amazeelabs/a80669323be9c6e6c5b45dfc858442b7 to your computer and use it in GitHub Desktop.
CSS-in-JS example #4
This file contains hidden or 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 { styled, css } from 'some-css-in-js-project'; | |
| const Wrapper = styled.div` | |
| color: #fff; | |
| &:hover { | |
| background-color: #0074d9; | |
| } | |
| {props => props.primary && css` | |
| background-color: #0074D9; | |
| `} | |
| {props => props.warning && css` | |
| background-color: ${someValueReturnedByAFunction()}, | |
| `} | |
| `; | |
| export const MyComponent = () => ( | |
| <Wrapper warning>Some content</Wrapper> | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment