Skip to content

Is it by-design or a bug that button icon's color doesn't change with its text? #5160

Answered by asyncLiz
datvm asked this question in Q&A
Discussion options

You must be logged in to vote

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;

You're correct that the --_underscore-tokens are not meant to be used. However, they can be a good indication of what the name is. --_icon-color means --md-text-button-icon-color, --md-filled-button-icon-color, and so on.

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;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@datvm
Comment options

Answer selected by datvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants