Last active
December 21, 2016 17:25
-
-
Save weslleyaraujo/4dd6e5c057788310380de534e1e85d88 to your computer and use it in GitHub Desktop.
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 color from ‘color’; // a simple color helper library | |
import styled from ‘styled-components’; | |
const lighten = from => color(from).lighten(0.333).hexString(); | |
const activeCSS = props => ` | |
background-color: ${lighten(props.color)} !important; | |
`; | |
export const Pad = styled.div` | |
/* some styles here … */ | |
${(props) => props.active ? activeCSS(props) : ‘’} | |
background-color: ${({ color }) => color} | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment