Material-UI comes with a default theme. We can use this as the starting point to create our own theme. There are two main steps to creating a new theme in Material-UI:
- Use the createMuiTheme() function to customize the default theme settings and return a new theme object.
- Use the ThemeProvider component to wrap our application so that the appropriate theme is applied.
Let's take a look at how this process works in action:
import "typeface-roboto";
import React from "react";
import { createMuiTheme } from "@material-ui/core/styles";
import { ThemeProvider } from "@material-ui/styles";
import Menu from "@material-ui/core/Menu";
import MenuItem from "@material-ui/core/MenuItem";
const theme = createMuiTheme({
typography: {
fontSize: 11
},
overrides: {
MuiMenuItem: {
root: {
marginLeft: 15,
marginRight: 15
}
}
}
});
export default function App() {
return (
<ThemeProvider...