Skip to content

Instantly share code, notes, and snippets.

@itashdv
Created June 17, 2021 20:54
Show Gist options
  • Save itashdv/31a03a503ea7585a40125930e6b4151b to your computer and use it in GitHub Desktop.
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)
'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>
);
}
}
'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