Skip to content

Commit

Permalink
Merge pull request #686 from rishabhsharma1997/master
Browse files Browse the repository at this point in the history
chore: added inverseBackground in checkbox
  • Loading branch information
leecalcote authored Jul 22, 2024
2 parents 5b8d7a3 + 94614ab commit 5476179
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/theme/components/checkbox.modifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import { Components, Theme } from '@mui/material';

export const MuiCheckbox: Components<Theme>['MuiCheckbox'] = {
styleOverrides: {
root: ({ theme }) => {
root: ({ theme, ownerState }) => {
const {
palette: {
text: { default: defaultText },
icon: { inverse: inverseColor },
background: { brand },
border: { strong }
}
} = theme;

const inverseBackground = ownerState.inverseBackground || false;

return {
color: 'transparent',
'&.Mui-checked': {
Expand All @@ -25,7 +29,8 @@ export const MuiCheckbox: Components<Theme>['MuiCheckbox'] = {
'& .MuiSvgIcon-root': {
width: '1.25rem',
height: '1.25rem',
border: `.75px solid ${strong}`,
fill: inverseBackground ? inverseColor : defaultText,
border: `.75px solid ${inverseBackground ? inverseColor : strong}`,
borderRadius: '2px',
padding: '0px'
},
Expand Down

0 comments on commit 5476179

Please sign in to comment.