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 <tw15egan@gmail.com>
  • Loading branch information
janhassel and tw15egan authored Mar 23, 2020
1 parent 4ed9f56 commit e2c60ed
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 @@ -6279,7 +6279,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 @@ -7669,7 +7668,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 @@ -13211,11 +13209,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 @@ -13263,17 +13266,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 @@ -13292,8 +13284,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 e2c60ed

Please sign in to comment.