Skip to content

Commit 94614ab

Browse files
author
captain-Akshay
committed
chore: added inverseBackground in checkbox
Signed-off-by: captain-Akshay <[email protected]>
1 parent 22f1e0b commit 94614ab

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/theme/components/checkbox.modifier.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import { Components, Theme } from '@mui/material';
22

33
export const MuiCheckbox: Components<Theme>['MuiCheckbox'] = {
44
styleOverrides: {
5-
root: ({ theme }) => {
5+
root: ({ theme, ownerState }) => {
66
const {
77
palette: {
88
text: { default: defaultText },
9+
icon: { inverse: inverseColor },
910
background: { brand },
1011
border: { strong }
1112
}
1213
} = theme;
14+
15+
const inverseBackground = ownerState.inverseBackground || false;
16+
1317
return {
1418
color: 'transparent',
1519
'&.Mui-checked': {
@@ -25,7 +29,8 @@ export const MuiCheckbox: Components<Theme>['MuiCheckbox'] = {
2529
'& .MuiSvgIcon-root': {
2630
width: '1.25rem',
2731
height: '1.25rem',
28-
border: `.75px solid ${strong}`,
32+
fill: inverseBackground ? inverseColor : defaultText,
33+
border: `.75px solid ${inverseBackground ? inverseColor : strong}`,
2934
borderRadius: '2px',
3035
padding: '0px'
3136
},

0 commit comments

Comments
 (0)