mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
fix(Role): default color hover state should be white svg fill
This commit is contained in:
parent
f8e7b4f10b
commit
c78f2427a5
1 changed files with 6 additions and 10 deletions
|
@ -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 { 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';
|
||||||
|
@ -34,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)'};
|
||||||
}
|
}
|
||||||
|
@ -58,17 +59,12 @@ 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);
|
||||||
${Circle} svg {
|
${Circle} svg {
|
||||||
fill-opacity: 1;
|
fill-opacity: 1;
|
||||||
${onSmallScreen(
|
|
||||||
css`
|
|
||||||
fill-opacity: 0;
|
|
||||||
`
|
|
||||||
)}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,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