Last active
May 20, 2021 03:34
-
-
Save ilhamsa1/5b54c3cb8cfbe3a5d80671d848607784 to your computer and use it in GitHub Desktop.
add jss golbal with material-ui
This file contains hidden or 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
| import MonsteredRegular from '~/public/fonts/Montserrat/Montserrat-Regular.otf' | |
| const GlobalCss = withStyles({ | |
| // @global is handled by jss-plugin-global. | |
| '@global': { | |
| // You should target [class*="MuiButton-root"] instead if you nest themes. | |
| '.MuiButton-root': { | |
| fontSize: '1rem', | |
| }, | |
| '.exampleClass': { | |
| backgroundColor: 'blue', | |
| }, | |
| '@font-face': { | |
| fontFamily: 'Montserrat', | |
| fontStyle: 'normal', | |
| fontWeight: 400, | |
| fontDisplay: 'swap', | |
| src: `url(${MonsteredRegular})`, | |
| }, | |
| }, | |
| })(() => null) | |
| render() { | |
| return ( | |
| <Suspense fallback={<Loader />}> | |
| <GlobalCss /> | |
| <div className={classes.rootContainer}> | |
| <CssBaseline /> | |
| </div> | |
| </Suspense> | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment