Fix/role tap styling (#321)

* fix(Role): don't show role state svgs on mobile hover

* fix(Role): default color hover state should be white svg fill
This commit is contained in:
41666 2021-07-14 22:08:50 -04:00 committed by GitHub
parent 8158ae38f1
commit e5d83bc133
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,4 @@
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';
@ -33,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)'};
}
@ -57,7 +59,7 @@ 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);
@ -70,7 +72,7 @@ export const Outer = styled.div<StyledProps>`
transform: translateY(0);
box-shadow: 0 0 0 transparent;
}
`
`)
: null};
`;