Target another styled component on hover

后端 未结 5 909
长情又很酷
长情又很酷 2020-12-12 11:42

What is the best way to handle hovers in styled-components. I have a wrapping element that when hovered will reveal a button.

I could implement some state on the com

5条回答
  •  独厮守ぢ
    2020-12-12 12:10

    My solution is

    const Content = styled.div`
      &:hover + ${ImgPortal} {
        &:after {
          opacity: 1;
        }
      }
    `;
    

提交回复
热议问题