I need to apply a background color to a disabled button, but the following did not work and no error is shown in the browser's console.


  1. Using styling hooks (mentioned here), how can I change the background color of a disabled button?

What I tried that didn't work


    <lightning-button disabled variant="neutral" label="test" title="test" class="myDisabledClass"></lightning-button>


.myDisabledClass {
  --slds-c-button-neutral-color-background-disabled: red;

1 Answer 1


I believe this is not currently possible (but used to be). In the "What's new" section of the SLDS documentation, it makes note of removing the disabled state styling hooks with an intent to implement them at the global/theme level. However, I don't think that's happened yet.

https://www.lightningdesignsystem.com/release-notes/ Check under "Release 2.14.0 - December 16, 2020"

I'd be very happy to be proved wrong, though....

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .