188
rated 0 times
[
191]
[
3]
/ answers: 1 / hits: 30338
/ 6 Years ago, mon, april 2, 2018, 12:00:00
I'm trying to style the child component of a styled-component, but it sends the css to the parent instead of the child/ This is my code,
export const Card = styled.div`
position: relative;
${props => props.horizontal && `
${CardImage}{
max-height: 60%;
overflow: hidden;
}`}
`
export const CardImage = styled.div`
position: relative;
`
EDIT: When I add a condition before rendering that's when it doesn't work
More From » reactjs