When you use the lightning-button base component, the custom classes are applied to the outer elements of the component, which means that the following lightning-button markup doesn’t display the expected styling.
1<!-- Custom styling does not work here -->2<lightning-button label="Reset" class="buttonColor buttonText"></lightning-button>
Your custom CSS is automatically scoped to your own component to prevent styling of a base component’s internals. We recommend that you use Lightning Design System classes or the variants on a base component where possible.
Note
In this case, we recommend that you use the variant attribute on lightning-button. For example, use the destructive variant to make the background color red.
Let’s take a look at another example where migrating CSS can work for a base component. For example, you have the following lightning:formattedAddress markup.