Skip to content

Commit 7d078b2

Browse files
brichetfcollonval
andauthored
Change disabled button style (#77)
* 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 <fcollonval@users.noreply.github.com>
1 parent 6cb723a commit 7d078b2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/components/src/button/button.styles.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -661,12 +661,6 @@ export const buttonStyles: (
661661
appearanceBehavior(
662662
'stealth',
663663
css`
664-
:host([appearance='stealth'][disabled]),
665-
:host([appearance='stealth'][disabled]:hover),
666-
:host([appearance='stealth'][disabled]:active) {
667-
background: ${neutralFillStealthRest};
668-
}
669-
670664
${StealthButtonStyles}
671665
`.withBehaviors(
672666
forcedColorsStylesheetBehavior(css`

packages/components/src/design-tokens.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
accentForegroundHoverDelta,
1111
accentForegroundRestDelta,
1212
ColorRecipe,
13+
disabledOpacity,
1314
fillColor,
1415
InteractiveColorRecipe,
1516
InteractiveSwatchSet,
@@ -174,6 +175,9 @@ export {
174175

175176
const { create } = DesignToken;
176177

178+
// Changing the default to increase contrast
179+
disabledOpacity.withDefault(0.4);
180+
177181
/*
178182
* The error palette is built using the same color algorithm as the accent palette
179183
* But by copying the algorithm from @microsoft/fast-components at commit 03d711f222bd816834a5e1d60256d3e083b27c27

0 commit comments

Comments
 (0)