fix(Role): default color hover state should be white svg fill

This commit is contained in:
41666 2021-07-14 22:01:23 -04:00
parent f8e7b4f10b
commit c78f2427a5

View file

@ -1,4 +1,4 @@
import { onSmallScreen } from '@roleypoly/design-system/atoms/breakpoints';
import { onTablet } from '@roleypoly/design-system/atoms/breakpoints';
import { palette } from '@roleypoly/design-system/atoms/colors';
import { transitions } from '@roleypoly/design-system/atoms/timings';
import styled, { css } from 'styled-components';
@ -34,9 +34,10 @@ export const Circle = styled.div<StyledProps>`
width: 10px;
height: 10px;
fill-opacity: ${(props) => (props.selected || props.disabled ? 1 : 0)};
transition: fill-opacity ${transitions.in2in}s ease-in-out;
transition: fill-opacity ${transitions.in2in}s ease-in-out,
fill ${transitions.in2in}s ease-in-out;
fill: ${(props) =>
props.disabled && props.defaultColor
(props.disabled || !props.selected) && props.defaultColor
? 'var(--role-color)'
: 'var(--role-contrast)'};
}
@ -58,17 +59,12 @@ export const Outer = styled.div<StyledProps>`
cursor: pointer;
${(props) =>
!props.disabled
? css`
? onTablet(css`
&:hover {
transform: translateY(-2px);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
${Circle} svg {
fill-opacity: 1;
${onSmallScreen(
css`
fill-opacity: 0;
`
)}
}
}
@ -76,7 +72,7 @@ export const Outer = styled.div<StyledProps>`
transform: translateY(0);
box-shadow: 0 0 0 transparent;
}
`
`)
: null};
`;