Skip to content

Instantly share code, notes, and snippets.

@technology-amazeelabs
Last active March 27, 2019 11:56
Show Gist options
  • Save technology-amazeelabs/6466462419b05a3cc54f24a2485573ae to your computer and use it in GitHub Desktop.
Save technology-amazeelabs/6466462419b05a3cc54f24a2485573ae to your computer and use it in GitHub Desktop.
CSS-in-JS example #3
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