Skip to content

Commit

Permalink
Merge pull request #10859 from ethereum/button-disabled-styles
Browse files Browse the repository at this point in the history
Button - Fix disabled styles in solid variant
  • Loading branch information
pettinarip authored Aug 3, 2023
2 parents d34da17 + f25d7ff commit c64304f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/@chakra-ui/gatsby-plugin/components/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const variantSolid = defineStyle({
color: "background.base",
bg: "primary.base",
borderColor: "transparent",
_disabled: {
bg: "disabled",
color: "background.base",
},
_hover: {
color: "background.base",
bg: "primary.hover",
Expand Down
2 changes: 1 addition & 1 deletion src/@chakra-ui/gatsby-plugin/semanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const semanticTokens = {
base: { _light: "white", _dark: "gray.700" },
highlight: { _light: "gray.100", _dark: "gray.900" },
},
disabled: { _light: "gray.300", _dark: "gray.500" },
disabled: { _light: "gray.400", _dark: "gray.500" },
// ! Deprecating neutral
neutral: { _light: "white", _dark: "gray.900" },

Expand Down
7 changes: 6 additions & 1 deletion src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ export const StyleVariants: Story = {
<VStack spacing={4}>
{variants.map((variant, idx) => {
if (args.isSecondary && variant === "solid") return
return <Button key={idx} variant={variant} {...args} />
return (
<HStack spacing={4} key={idx}>
<Button variant={variant} {...args} />
<Button variant={variant} isDisabled {...args} />
</HStack>
)
})}
</VStack>
),
Expand Down

0 comments on commit c64304f

Please sign in to comment.