Skip to content

Commit

Permalink
Change disabled button style (#77)
Browse files Browse the repository at this point in the history
* Remove background on disabled button

* Change the default disabled opacity

* remove background style for disabled buttons on hover and active, and avoid creating agin the opacity token

* Add code comment

* Update button.styles.ts

---------

Co-authored-by: Frédéric Collonval <[email protected]>
  • Loading branch information
brichet and fcollonval authored Nov 21, 2023
1 parent 6cb723a commit 7d078b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 0 additions & 6 deletions packages/components/src/button/button.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,6 @@ export const buttonStyles: (
appearanceBehavior(
'stealth',
css`
:host([appearance='stealth'][disabled]),
:host([appearance='stealth'][disabled]:hover),
:host([appearance='stealth'][disabled]:active) {
background: ${neutralFillStealthRest};
}
${StealthButtonStyles}
`.withBehaviors(
forcedColorsStylesheetBehavior(css`
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/design-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
accentForegroundHoverDelta,
accentForegroundRestDelta,
ColorRecipe,
disabledOpacity,
fillColor,
InteractiveColorRecipe,
InteractiveSwatchSet,
Expand Down Expand Up @@ -174,6 +175,9 @@ export {

const { create } = DesignToken;

// Changing the default to increase contrast
disabledOpacity.withDefault(0.4);

/*
* The error palette is built using the same color algorithm as the accent palette
* But by copying the algorithm from @microsoft/fast-components at commit 03d711f222bd816834a5e1d60256d3e083b27c27
Expand Down

0 comments on commit 7d078b2

Please sign in to comment.