Skip to content

Instantly share code, notes, and snippets.

@ilhamsa1
Last active May 20, 2021 03:34
Show Gist options
  • Select an option

  • Save ilhamsa1/5b54c3cb8cfbe3a5d80671d848607784 to your computer and use it in GitHub Desktop.

Select an option

Save ilhamsa1/5b54c3cb8cfbe3a5d80671d848607784 to your computer and use it in GitHub Desktop.
add jss golbal with material-ui
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