Created
June 17, 2021 20:54
-
-
Save itashdv/31a03a503ea7585a40125930e6b4151b to your computer and use it in GitHub Desktop.
Material-UI v4 Menu (override styles of the dropdown component ul & li GLOBALLY)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React from "react"; | |
import { ThemeProvider } from '@material-ui/styles'; | |
import CssBaseline from '@material-ui/core/CssBaseline'; | |
import theme from 'theme.js'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<ThemeProvider theme={theme}> | |
<CssBaseline /> | |
{/* Your app content */} | |
</ThemeProvider> | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import { createMuiTheme } from '@material-ui/core/styles'; | |
const theme = createMuiTheme({ | |
overrides: { | |
// Applied to the <ul> element | |
MuiMenu: { | |
list: { | |
backgroundColor: "#cccccc", | |
}, | |
}, | |
// Applied to the <li> elements | |
MuiMenuItem: { | |
root: { | |
fontSize: 12, | |
}, | |
}, | |
}, | |
}); | |
export default theme; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment