Skip to content

Instantly share code, notes, and snippets.

@benknight
Last active August 14, 2017 02:09
Show Gist options
  • Save benknight/3d6038bc0ed41c55bbc81c960e814086 to your computer and use it in GitHub Desktop.
Save benknight/3d6038bc0ed41c55bbc81c960e814086 to your computer and use it in GitHub Desktop.
CSS in JS ideas
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;
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