Remove CSS rule for Material UI component in theme overrides

Viewed 162

I want to remove the CSS padding-bottom in the Material UI CardContent component. But I only find solutions on setting it to something else. My current workaround is to set it to something invalid (e.g. -1) so browsers will just ignore it.

I have this theme which contains the workaround:

export default createMuiTheme({
  overrides: {
    MuiCardContent: {
      root: {
        "&:last-child": {
          paddingBottom: -1,
        },
      },
    },
  },
});

would would be the correct way of remove a css rule from a component in Material UI. (I already tried inherit, initial, revert and unset). Setting it to 0 is not what I want because I want the padding of the MuiCardContent without last-child to get applied.

0 Answers
Related