Skip to content

Commit

Permalink
fix(button): prevent style changes on hover for disabled form buttons (
Browse files Browse the repository at this point in the history
  • Loading branch information
saiponnada authored Mar 15, 2024
1 parent 96fd3fc commit f39fdfa
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-forks-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/skin": minor
---

fix(button): prevent style changes on hover for disabled form buttons
12 changes: 6 additions & 6 deletions dist/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ a.fake-btn--form {
border-radius: var(--expand-btn-border-radius, var(--border-radius-50));
max-width: 100%;
}
button.btn--form:hover,
a.fake-btn--form:hover,
button.btn--form:focus,
a.fake-btn--form:focus {
button.btn--form:not([disabled], [aria-disabled="true"]):hover,
a.fake-btn--form:not([href]):hover,
button.btn--form:not([disabled], [aria-disabled="true"]):focus,
a.fake-btn--form:not([href]):focus {
background-color: var(--color-state-primary-hover);
}
button.btn--form:active,
a.fake-btn--form:active {
button.btn--form:not([disabled], [aria-disabled="true"]):active,
a.fake-btn--form:not([href]):active {
background-color: var(--color-state-primary-active);
}
button.btn--form.btn--large {
Expand Down
10 changes: 5 additions & 5 deletions dist/listbox-button/listbox-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ button.expand-btn[aria-expanded="true"] ~ div.listbox-button__listbox,
.listbox-button button[aria-invalid="true"] {
border-color: var(--listbox-button-invalid-border-color, var(--color-stroke-attention));
}
.listbox-button:not(.listbox-button--error) button.btn--form {
.listbox-button:not(.listbox-button--error) button:not([disabled], [aria-disabled="true"]).btn--form {
border-color: var(--listbox-button-border-color, var(--color-stroke-default));
}
.listbox-button:not(.listbox-button--error) button.btn--form:hover,
.listbox-button:not(.listbox-button--error) button.btn--form:focus,
.listbox-button:not(.listbox-button--error) button.btn--form:active {
.listbox-button:not(.listbox-button--error) button:not([disabled], [aria-disabled="true"]).btn--form:hover,
.listbox-button:not(.listbox-button--error) button:not([disabled], [aria-disabled="true"]).btn--form:focus,
.listbox-button:not(.listbox-button--error) button:not([disabled], [aria-disabled="true"]).btn--form:active {
border-color: inherit;
}
.listbox-button button.expand-btn--borderless,
Expand All @@ -77,7 +77,7 @@ button.expand-btn[aria-expanded="true"] ~ div.listbox-button__listbox,
.listbox-button.listbox-button--form button[disabled],
.listbox-button.listbox-button--form button[aria-disabled="true"] {
border-color: var(--listbox-button-disabled-border-color, var(--color-background-disabled));
color: var(--listbox-button-disabled-foreground-color, var(--color-foreground-primary));
color: var(--listbox-button-disabled-foreground-color, var(--color-foreground-disabled));
}
.listbox-button.listbox-button--form button:focus {
background-color: var(--combobox-textbox-focus-background-color, var(--color-background-primary));
Expand Down
3 changes: 3 additions & 0 deletions src/less/button/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ a.fake-btn--form {
border-color: inherit;
.border-radius-token(expand-btn-border-radius, border-radius-50);
max-width: 100%;
}

button.btn--form:not([disabled], [aria-disabled="true"]),
a.fake-btn--form:not([href]) {
&:hover,
&:focus {
background-color: var(--color-state-primary-hover);
Expand Down
5 changes: 3 additions & 2 deletions src/less/listbox-button/listbox-button.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ button.expand-btn[aria-expanded="true"] ~ div.listbox-button__listbox,
.border-color-token(listbox-button-invalid-border-color, color-stroke-attention);
}

.listbox-button:not(.listbox-button--error) button.btn--form {
.listbox-button:not(.listbox-button--error)
button:not([disabled], [aria-disabled="true"]).btn--form {
.border-color-token(listbox-button-border-color, color-stroke-default);

&:hover,
Expand Down Expand Up @@ -78,7 +79,7 @@ button.expand-btn[aria-expanded="true"] ~ div.listbox-button__listbox,
.listbox-button.listbox-button--form button[disabled],
.listbox-button.listbox-button--form button[aria-disabled="true"] {
.border-color-token(listbox-button-disabled-border-color, color-background-disabled);
.color-token(listbox-button-disabled-foreground-color, color-foreground-primary);
.color-token(listbox-button-disabled-foreground-color, color-foreground-disabled);
}

.listbox-button.listbox-button--form button:focus {
Expand Down

0 comments on commit f39fdfa

Please sign in to comment.