Skip to content

Commit

Permalink
Merge pull request #8301 from amit-ksh/disabled-button-style
Browse files Browse the repository at this point in the history
fixes the hover style for disabled button
  • Loading branch information
pettinarip authored Oct 26, 2022
2 parents 403cd50 + 5cfa7b3 commit 287aa2f
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions src/@chakra-ui/gatsby-plugin/components/Button.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import type { ComponentStyleConfig } from "@chakra-ui/theme"

const disabledStylesSolid = {
bg: "disabled",
opacity: 1,
}

const disabledStylesOutline = {
color: "disabled",
borderColor: "disabled",
opacity: 1,
}

const commonOutline = {
border: "1px",
color: "text",
Expand All @@ -9,6 +20,9 @@ const commonOutline = {
color: "primary",
bg: "background",
borderColor: "primary",
_disabled: {
...disabledStylesOutline,
},
},
_active: {
color: "primary",
Expand All @@ -18,11 +32,12 @@ const commonOutline = {
_focus: {
color: "primary",
borderColor: "background",
_disabled: {
...disabledStylesOutline,
},
},
_disabled: {
color: "disabled",
borderColor: "disabled",
opacity: 1,
...disabledStylesOutline,
},
}

Expand All @@ -33,6 +48,9 @@ export const Button: ComponentStyleConfig = {
_hover: {
textDecoration: "none",
boxShadow: "primary",
_disabled: {
boxShadow: "none",
},
},
_focus: {
boxShadow: "outline",
Expand All @@ -53,13 +71,15 @@ export const Button: ComponentStyleConfig = {
_hover: {
bg: "primary",
opacity: 0.8,
_disabled: {
...disabledStylesSolid,
},
},
_active: {
bg: "primaryHover",
},
_disabled: {
bg: "disabled",
opacity: 1,
...disabledStylesSolid,
},
},
outline: {
Expand Down

0 comments on commit 287aa2f

Please sign in to comment.