mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
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:
parent
8158ae38f1
commit
e5d83bc133
1 changed files with 6 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import { onTablet } from '@roleypoly/design-system/atoms/breakpoints';
|
||||||
import { palette } from '@roleypoly/design-system/atoms/colors';
|
import { palette } from '@roleypoly/design-system/atoms/colors';
|
||||||
import { transitions } from '@roleypoly/design-system/atoms/timings';
|
import { transitions } from '@roleypoly/design-system/atoms/timings';
|
||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
|
@ -33,9 +34,10 @@ export const Circle = styled.div<StyledProps>`
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
fill-opacity: ${(props) => (props.selected || props.disabled ? 1 : 0)};
|
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) =>
|
fill: ${(props) =>
|
||||||
props.disabled && props.defaultColor
|
(props.disabled || !props.selected) && props.defaultColor
|
||||||
? 'var(--role-color)'
|
? 'var(--role-color)'
|
||||||
: 'var(--role-contrast)'};
|
: 'var(--role-contrast)'};
|
||||||
}
|
}
|
||||||
|
@ -57,7 +59,7 @@ export const Outer = styled.div<StyledProps>`
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
${(props) =>
|
${(props) =>
|
||||||
!props.disabled
|
!props.disabled
|
||||||
? css`
|
? onTablet(css`
|
||||||
&:hover {
|
&:hover {
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||||
|
@ -70,7 +72,7 @@ export const Outer = styled.div<StyledProps>`
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
box-shadow: 0 0 0 transparent;
|
box-shadow: 0 0 0 transparent;
|
||||||
}
|
}
|
||||||
`
|
`)
|
||||||
: null};
|
: null};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue