Skip to content

Instantly share code, notes, and snippets.

@kcliu
Last active April 11, 2017 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kcliu/80c6824ff2b06acf60eb7504fe7e5205 to your computer and use it in GitHub Desktop.
Save kcliu/80c6824ff2b06acf60eb7504fe7e5205 to your computer and use it in GitHub Desktop.
import styled from 'styled-components';
const isCurrent = (current, key) => current.group === key[0] && current.attr === key[1] ? true : false;
const hoverColor = '#9c9c9c';
const activeColor = '#00bbff';
const pressColor= '#6c6c6c';
export const BorderWrap = styled.div`
position: relative;
`;
export const Border = styled.div`
position: absolute;
width: ${props => props.width ? props.width : '100%'};
height: ${props => props.height ? props.height : '100%'};
top: ${props => props.top ? props.top : 0}; : 0};
left: ${props => props.left ? props.left : 0};
border: ${props => isCurrent(props.current, props.name) ? `2px solid ${activeColor}` : '2px solid transparent'};
&:hover {
border-color: ${hoverColor};
}
&:active {
border-color: ${pressColor};
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment