Skip to content

Commit

Permalink
Fix back button transparency on hover
Browse files Browse the repository at this point in the history
and other `variant=‘pill’ color=‘inherit’` buttons
  • Loading branch information
bramvanderholst authored and paales committed Aug 21, 2024
1 parent 7cd5c1c commit 7c10458
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-badgers-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-ui': patch
---

Fix back button transparency on hover
12 changes: 10 additions & 2 deletions packages/next-ui/Theme/MuiButton.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentsVariants, Theme, alpha } from '@mui/material'
import { ComponentsVariants, Theme, alpha, darken, lighten } from '@mui/material'
import { responsiveVal } from '../Styles/responsiveVal'

declare module '@mui/material/Button/Button' {
Expand Down Expand Up @@ -126,7 +126,15 @@ export const MuiButtonPill: ButtonVariants = [
},
{
props: { variant: 'pill', color: 'inherit' },
style: ({ theme }) => ({ backgroundColor: theme.palette.background.paper }),
style: ({ theme }) => ({
backgroundColor: theme.palette.background.paper,
'&:hover:not(.Mui-disabled)': {
backgroundColor:
theme.palette.mode === 'light'
? darken(theme.palette.background.default, 0.05)
: lighten(theme.palette.background.default, 0.2),
},
}),
},
{
props: { variant: 'pill', disabled: true },
Expand Down

0 comments on commit 7c10458

Please sign in to comment.