-
<md-text-button style="--md-text-button-label-text-color: red">
<md-icon slot="icon">send</md-icon>
Hello
</md-text-button>
<md-filled-button style="--md-filled-button-label-text-color: cyan">
<md-icon slot="icon">send</md-icon>
Hello
</md-filled-button>
<md-filled-button style="--md-filled-button-label-text-color: cyan; --_icon-color: cyan;">
<md-icon slot="icon">send</md-icon>
Hello
</md-filled-button> I also noticed when hovering the button, the color revert to default and all the variables start with a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It is by design, since label text and icons have different tokens. --md-text-button-label-text-color: red;
--md-text-button-icon-color: red;
Many tokens also have additional tokens for states like hover, pressed, focus, and disabled that need to be set, which is why the color reverts on hover. --md-text-button-label-text-color: red;
--md-text-button-hover-label-text-color: red;
--md-text-button-focus-label-text-color: red;
--md-text-button-pressed-label-text-color: red; You can see a list of supported tokens for each variant in the theming section of the component docs. For example, here's the link to the elevated button's tokens. We acknowledge this is a lot, and we hope to improve things 😣 One recommendation we suggest is to use .cyan-button {
--md-sys-color-primary: cyan;
--md-sys-color-on-primary: black;
} Check out How do I change the color of a button? |
Beta Was this translation helpful? Give feedback.
It is by design, since label text and icons have different tokens.
Many tokens also have additional tokens for states like hover, pressed, focus, and disabled that need to be set, which is why the color reverts on hover.
…