Change more SVG path color when hover

后端 未结 2 1976
时光说笑
时光说笑 2021-01-25 07:28

I have this code below.



        
2条回答
  •  醉酒成梦
    2021-01-25 07:34

    Maybe with some CSS variables. You cannot target elements inside the use but you can rely on inheritance to pass some values.

    .icon {
      stroke-width: 0;
      stroke: currentColor;
      fill: currentColor;
    }
    
    a {
      color: red
    }
    
    a:hover {
      color: pink;
      --s1:green;
      --s2:blue;
      --p1:purple;
      --p2:yellow;
    }
    
    
    

提交回复
热议问题