Hover and Active only when not disabled

后端 未结 7 2064
长情又很酷
长情又很酷 2020-12-22 21:29

I use hover, active and disabled to style Buttons.

But the problem is when the button is disabled the hover and ac

7条回答
  •  再見小時候
    2020-12-22 21:59

    In sass (scss):

     button {
      color: white;
      cursor: pointer;
      border-radius: 4px;
    
      &:disabled{
        opacity: 0.4;
    
        &:hover{
          opacity: 0.4;  //this is what you want
        }
      }
    
      &:hover{
        opacity: 0.9;
      }
    }
    

提交回复
热议问题