Skip to content

Instantly share code, notes, and snippets.

@technology-amazeelabs
Last active March 27, 2019 11:56
Show Gist options
  • Select an option

  • Save technology-amazeelabs/a80669323be9c6e6c5b45dfc858442b7 to your computer and use it in GitHub Desktop.

Select an option

Save technology-amazeelabs/a80669323be9c6e6c5b45dfc858442b7 to your computer and use it in GitHub Desktop.
CSS-in-JS example #4
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