Last active
August 14, 2017 02:09
-
-
Save benknight/3d6038bc0ed41c55bbc81c960e814086 to your computer and use it in GitHub Desktop.
CSS in JS ideas
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 { cx } from 'css-in-js'; | |
import { flex, flexAuto, noWrap } from '../styles/utilities'; | |
import { Button, Button__green } from './styles'; | |
const Button = props => { | |
const className = cx([ | |
flex, | |
flexAuto, | |
Button, | |
props.isGreen && Button__green | |
]); | |
return <button className={className}>{props.children}</button>; | |
}; | |
export default Button; |
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 styles = [ | |
<StyleRule | |
className="Button" | |
minWidth={200} | |
maxWidth={100} | |
whiteSpace="nowrap"> | |
<StyleRule element="a" color="black" /> | |
</StyleRule> | |
]; | |
const Button = props => { | |
return <button styleDef="Button">{children}</button>; | |
} | |
export default withStyles(styles)(Button); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment