Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change disabled button style #77

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions packages/components/src/button/button.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ export const buttonStyles: (
appearanceBehavior(
'accent',
css`
:host([appearance='accent'][disabled]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for changing the accent type case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency.
And maybe we should also remove the background-color property of :host([disabled]) too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep it for now as in the opposite of the stealth appearance, the background-color is controlled by the toolkit.

:host([appearance='accent'][disabled]:hover),
:host([appearance='accent'][disabled]:active) {
background: ${accentFillRest};
Expand Down Expand Up @@ -661,12 +660,6 @@ export const buttonStyles: (
appearanceBehavior(
'stealth',
css`
:host([appearance='stealth'][disabled]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the all block including on hover and on active case as the goal is to avoid style change when the button is disabled.

:host([appearance='stealth'][disabled]:hover),
:host([appearance='stealth'][disabled]:active) {
background: ${neutralFillStealthRest};
}

${StealthButtonStyles}
`.withBehaviors(
forcedColorsStylesheetBehavior(css`
Expand Down
3 changes: 3 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,8 @@ export {

const { create } = DesignToken;

disabledOpacity.withDefault(0.4);
fcollonval marked this conversation as resolved.
Show resolved Hide resolved

/*
* 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
Loading