Skip to content

Commit

Permalink
feat(iconbutton): add disabled-icon-opacity token
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 530782342
  • Loading branch information
asyncLiz authored and copybara-github committed May 10, 2023
1 parent d029b63 commit 7403ce1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions iconbutton/lib/_filled-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
);
}

.icon-button:disabled .icon {
opacity: var(--_disabled-icon-opacity);
}

.toggle-filled {
&:not(:disabled) {
background-color: var(--_unselected-container-color);
Expand Down
4 changes: 4 additions & 0 deletions iconbutton/lib/_filled-tonal-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ $_custom-property-prefix: 'filled-tonal-icon-button';
);
}

.icon-button:disabled .icon {
opacity: var(--_disabled-icon-opacity);
}

.toggle-filled-tonal {
&:not(:disabled) {
background-color: var(--_unselected-container-color);
Expand Down
4 changes: 4 additions & 0 deletions iconbutton/lib/_outlined-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
}
}

.outlined:disabled .icon {
opacity: var(--_disabled-icon-opacity);
}

.outlined::before {
block-size: 100%;
border-style: solid;
Expand Down
3 changes: 1 addition & 2 deletions iconbutton/lib/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
// changes, so the opacity value is null), use the default opacity value.
// Otherwise, the color is not flattened, meaning that the color would
// be applied without any opacity, which is incorrect.
$opacity-keys: [ 'disabled-container-opacity', 'disabled-icon-opacity',
$opacity-keys: [ 'disabled-container-opacity',
'disabled-selected-container-opacity' ];

@each $opacity-key in $opacity-keys {
Expand Down Expand Up @@ -153,7 +153,6 @@
color-key: 'disabled-container-color',
opacity-key: 'disabled-container-opacity'
),
(color-key: 'disabled-icon-color', opacity-key: 'disabled-icon-opacity'),
(
color-key: 'disabled-selected-container-color',
opacity-key: 'disabled-selected-container-opacity'
Expand Down
4 changes: 4 additions & 0 deletions iconbutton/lib/_standard-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
}
}

.standard:disabled .icon {
opacity: var(--_disabled-icon-opacity);
}

.selected {
&:not(:disabled) {
color: var(--_selected-icon-color);
Expand Down

0 comments on commit 7403ce1

Please sign in to comment.