Skip to content

Commit

Permalink
fix(button): prevent hover on disabled buttons in g90/g100 theme (#5678)
Browse files Browse the repository at this point in the history
Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
2 people authored and Alessandra Davila committed Mar 25, 2020
1 parent f9da6c2 commit 04ae1e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
22 changes: 6 additions & 16 deletions packages/components/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -6247,7 +6247,6 @@ $ui-04: if(
- **Type**: `{undefined}`
- **Used by**:
- [carbon--theme [mixin]](#carbon--theme-mixin)
- [button-theme [mixin]](#button-theme-mixin)
- [date-picker [mixin]](#date-picker-mixin)
- [dropdown [mixin]](#dropdown-mixin)
- [file-uploader [mixin]](#file-uploader-mixin)
Expand Down Expand Up @@ -7637,7 +7636,6 @@ $disabled-02: if(
- [carbon--theme [mixin]](#carbon--theme-mixin)
- [button [mixin]](#button-mixin)
- [button-base [mixin]](#button-base-mixin)
- [button-theme [mixin]](#button-theme-mixin)
- [checkbox [mixin]](#checkbox-mixin)
- [combo-box [mixin]](#combo-box-mixin)
- [content-switcher [mixin]](#content-switcher-mixin)
Expand Down Expand Up @@ -13179,11 +13177,16 @@ Button base styles
margin: 0;

&:disabled,
&.#{$prefix}--btn--disabled {
&:hover:disabled,
&:focus:disabled,
&.#{$prefix}--btn--disabled,
&.#{$prefix}--btn--disabled:hover,
&.#{$prefix}--btn--disabled:focus {
cursor: not-allowed;
color: $disabled-03;
background: $disabled-02;
border-color: $disabled-02;
box-shadow: none;
}

.#{$prefix}--btn__icon {
Expand Down Expand Up @@ -13231,17 +13234,6 @@ Button variant styles
($button-border-width + $button-outline-width) $ui-02;
}

&:disabled:hover,
&:disabled:focus,
&:hover.#{$prefix}--btn--disabled,
&:focus.#{$prefix}--btn--disabled {
color: $ui-04;
background-color: $disabled-02;
border-color: $disabled-02;
text-decoration: none;
box-shadow: none;
}

&:active {
background-color: $active-color;
}
Expand All @@ -13260,8 +13252,6 @@ Button variant styles
- [focus [variable]](#focus-variable)
- [ui-02 [variable]](#ui-02-variable)
- [prefix [variable]](#prefix-variable)
- [ui-04 [variable]](#ui-04-variable)
- [disabled-02 [variable]](#disabled-02-variable)
- **Used by**:
- [button [mixin]](#button-mixin)

Expand Down
18 changes: 6 additions & 12 deletions packages/components/src/components/button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@
margin: 0;

&:disabled,
&.#{$prefix}--btn--disabled {
&:hover:disabled,
&:focus:disabled,
&.#{$prefix}--btn--disabled,
&.#{$prefix}--btn--disabled:hover,
&.#{$prefix}--btn--disabled:focus {
cursor: not-allowed;
color: $disabled-03;
background: $disabled-02;
border-color: $disabled-02;
box-shadow: none;
}

.#{$prefix}--btn__icon {
Expand Down Expand Up @@ -77,17 +82,6 @@
inset 0 0 0 ($button-border-width + $button-outline-width) $ui-02;
}

&:disabled:hover,
&:disabled:focus,
&:hover.#{$prefix}--btn--disabled,
&:focus.#{$prefix}--btn--disabled {
color: $ui-04;
background-color: $disabled-02;
border-color: $disabled-02;
text-decoration: none;
box-shadow: none;
}

&:active {
background-color: $active-color;
}
Expand Down

0 comments on commit 04ae1e9

Please sign in to comment.