Skip to content

Instantly share code, notes, and snippets.

@deckchairlabs
Created February 27, 2019 04:51
Show Gist options
  • Save deckchairlabs/40c9878e4176a0299248b14454f6db34 to your computer and use it in GitHub Desktop.
Save deckchairlabs/40c9878e4176a0299248b14454f6db34 to your computer and use it in GitHub Desktop.
vue emotion refactor
import { css, cx } from "emotion";
const baseStyles = () =>
css`
background-color: black;
color: white;
cursor: pointer;
padding: 10px;
&:hover {
background-color: red;
}
`;
const Button = {
functional: true,
props: {
variant: {
type: String,
default: "default"
}
},
render(h, { props }) {
const className = cx(baseStyles(props));
return (
<button type="button" class={className}>
My Cool Button
</button>
);
}
};
export default Button;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment