0

How to prevent a disabled button from become gray out when mouse down over it ? it should change the color, what would be the css property to tackle this issue ?

This is the button on disabled state

enter image description here

And this is the button after click on it or press and hold mouse

enter image description here

this is the styles for the button

   .btn {
      border: 0;
      cursor: pointer;
      display: inline-block;
      font-family: "Myriad-Regular";
      line-height: 2rem;
      margin: 1rem 0;
      padding: 2.2rem;
      text-align: center;
      text-transform: uppercase;
      white-space: nowrap;
      width: 100%;
    }
    
    .btn--primary {
      background: var(--color-primary);
      color: #fff;
    }
    
    .btn--primary:hover {
      background: #f79661;
    }
    
    .btn--primary:disabled {
      background: #f6c5ab;
    }

and this is the HTML markup

<button type="submit" class="btn btn--primary btn--small" disabled>Send</button>

I realized that the problem only happens on mobile platforms, i had chrome debugger in mobile device mode and also tested on my android Galaxy A42 and the problem persists

Mobile phone screen capture

Thanks a lot in advance!

Junior Silva
  • 387
  • 5
  • 17

1 Answers1

1

Works perfectly fine for me.
Edit your question to include your HTML

.btn {
  border: 0;
  cursor: pointer;
  display: inline-block;
  font-family: "Myriad-Regular";
  line-height: 2rem;
  margin: 1rem 0;
  padding: 2.2rem;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  width: 100%;
}

.btn--primary {
  background: #f6c5ab;
  color: #fff;
}

.btn--primary:hover {
  background: #f79661;
}

.btn--primary:disabled {
  background: #f6c5ab;
}
<button class="btn btn--primary">Normal button</button>
<button class="btn btn--primary" disabled>Disabled button</button>
Zach Jensz
  • 3,650
  • 5
  • 15
  • 30