How To Change Css Property based On light and Dark Mode In MUI React Framework? – Guide #2023

Table of Contents

check the mode inside of the theme object and use a ternary:

heading: {
        color: theme.palette.text.primary,
        fontSize: theme.palette.mode === 'light' ? '20px' : '118px',
    },

 

No data found.