Skip to content

Commit

Permalink
fix(Button): update styles in disabled Button (#3279)
Browse files Browse the repository at this point in the history
  • Loading branch information
HelenaIsh committed Oct 5, 2023
1 parent 3646b08 commit 80e2f91
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 21 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions packages/react-ui/components/Button/Button.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,12 @@ export const styles = memoizeStyle({
`;
},

backlessDisabled2022(t: Theme) {
return css`
box-shadow: 0 0 0 1px ${t.btnBacklessDisabledBorderColor};
`;
},

loading() {
return css`
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions packages/react-ui/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
checked && styles.checkedDisabled(this.theme),
checked && styles.checkedDisabled2022(this.theme),
borderless && styles.borderless2022(),
use === 'backless' && !checked && styles.backlessDisabled2022(this.theme),
]
: [
active && !checked && activeStyles[use](this.theme),
Expand Down
3 changes: 3 additions & 0 deletions packages/react-ui/internal/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ export class DefaultTheme {
public static get btnBacklessBorderColor() {
return this.btnDefaultBorderColor;
}
public static get btnBacklessDisabledBorderColor() {
return this.btnDisabledBorderColor;
}
public static get btnBacklessHoverBorderColor() {
return this.btnBacklessBorderColor;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/react-ui/internal/themes/Theme2022Dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ export class Theme2022Dark extends (class {} as typeof Theme2022Internal) {
public static btnBacklessHoverBg = 'rgba(255, 255, 255, 0.1) !important';
public static btnBacklessActiveBg = 'rgba(255, 255, 255, 0.06) !important';
public static btnBacklessBorderColor = 'rgba(255, 255, 255, 0.16) !important';
public static btnBacklessDisabledBorderColor = 'rgba(255, 255, 255, 0.06) !important';
public static btnBacklessHoverBorderColor = 'rgba(255, 255, 255, 0.1)';
public static btnBacklessTextColor = 'rgba(255, 255, 255, 0.87)';

public static btnTextBg = 'transparent';
public static btnTextBg = 'transparent !important';
public static btnTextHoverBg = 'rgba(255, 255, 255, 0.1)';
public static btnTextActiveBg = 'rgba(255, 255, 255, 0.06)';
public static btnTextBorderColor = 'transparent';
Expand Down

0 comments on commit 80e2f91

Please sign in to comment.