Skip to content

Instantly share code, notes, and snippets.

@kilgarenone
Last active October 23, 2018 08:25
Show Gist options
  • Save kilgarenone/10cc5d2a898e72db7be91366520c53f4 to your computer and use it in GitHub Desktop.
Save kilgarenone/10cc5d2a898e72db7be91366520c53f4 to your computer and use it in GitHub Desktop.
<Icon />`
import React from "react";
import { css, cx } from "react-emotion";
const defaultSvgCss = css`
position: relative;
display: inline-block;
vertical-align: middle;
`;
function Icon({ icon, color, size = 24, className }) {
return (
<svg
className={cx("icon", defaultSvgCss, className)}
width={size}
height={size}
viewBox="0 0 24 24"
fill="currentColor"
preserveAspectRatio="xMidYMid meet"
>
<path className="icon-path" fill={color} d={icon} />
</svg>
);
}
export default Icon;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment