Created
August 21, 2016 00:41
-
-
Save lachlanjc/09b12682c127c09b6b923221f37df6c1 to your computer and use it in GitHub Desktop.
Styling multiple elements with react-cxs
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
const Header = () => { | |
const cx = { | |
root: { | |
backgroundColor: colors.blue, | |
color: colors.white, | |
paddingBottom: space[4], | |
paddingTop: space[4] | |
}, | |
container: { | |
margin: 'auto', | |
maxWidth: '48rem' | |
}, | |
header: { | |
fontWeight: 'bold' | |
}, | |
subheader: { | |
fontWeight: 'normal' | |
} | |
} | |
return ( | |
<header className={cx.root}> | |
<div className={cx.container}> | |
<h1 className={cx.header}>Header</h1> | |
<h3 className={cx.subheader}>Subheader</h3> | |
</div> | |
</header> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment