Skip to content

Instantly share code, notes, and snippets.

@carl0zen
Created January 24, 2017 15:17
Show Gist options
  • Save carl0zen/29ef67857fa874f07fd737e2bdbdc97d to your computer and use it in GitHub Desktop.
Save carl0zen/29ef67857fa874f07fd737e2bdbdc97d to your computer and use it in GitHub Desktop.
Logo Component Example Using BEM and Styled Components
import React from "react"
import styled from "styled-components"
import { Icon } from "../ui/icon"
import { theme } from "../ui/theme"
const { color } = theme
const Logo = styled(Icon)`
.logo {
&__light{
&--small,
&--medium,
&--large {
fill: ${color.yellow};
}
}
&__heart {
&--left {
fill: ${color.primary};
opacity: 0.95;
}
&--right {
fill: ${color.primary};
opacity: 0.8;
}
}
}
`
export default ({size, ...props}) => (
<Logo name="logo" size={size || "7vmax"} {...props} />
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment