Skip to content

Instantly share code, notes, and snippets.

@weslleyaraujo
Last active December 21, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weslleyaraujo/4dd6e5c057788310380de534e1e85d88 to your computer and use it in GitHub Desktop.
Save weslleyaraujo/4dd6e5c057788310380de534e1e85d88 to your computer and use it in GitHub Desktop.
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