I want to apply a &:hover
only when a prop is passed - in this situacion: animated
const AnimationContainer = styled.div`
transform: translate(0%);
transition: 0.3s ease-out;
&:hover { // apply hover only when $(props.animated) is paased
position: fixed;
transform: translate(0%, -30%);
transition: 0.3s ease-out;
}
`;
Does anyone have a suggestion how to do it?
I guess it would be possible to apply the styling for every property just starting with .. :$(props => props.animated ? ..)
, but is there a simpler solution?