-- Clone this repository Them folder:
git clone https://github.com/Mahdi-Farahani/Material-ui-Global-Theme
-- Install Material UI /Styles
npm i @material-ui/styles
--Install tinycolor2
npm i tinycolor2
1- Add this Theme folder to your Project (example: src/theme)
2-Go to your HOC Component
and add :
import {ThemeProvider} from '@material-ui/core/styles';
import theme from '../src/theme';
3-Use ThemeProvider
with use theme props :
export default function App() {
return (
<ThemeProvider theme={theme.default}>
<App/>
</ThemeProvider>
);
}
- Fork it (https://github.com/Mahdi-Farahani/Material-ui-Global-Theme/fork)
- Commit your changes
- Push to the main branch
- Create a new Pull Request