Can't Override Global Typography
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
I should be able to modify the typography through the overrides and see purple text with a different fontfamily for all text in my application
Current Behavior
No change in color occurs or fontFamily
Steps to Reproduce (for bugs)
https://codesandbox.io/s/8444zvr28j
- Use createMuiTheme with object:
const theme = createMuiTheme({
overrides: {
MuiTypography: {
root: {
fontFamily: "Product Sans"
},
colorPrimary: purple
}
}
});
Context
I’m working on a side project using MuiTable, and all the fonts are defaulted to Roboto 😦
I am using react-starter-kit and have imported fonts using webpack
Your Environment
Tech | Version . |
---|---|
Material-UI | 1.0.0-beta.36 |
React | 16.2.0 |
browser | Chrome 64 . |
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Can't Override Global Typography · Issue #10552 - GitHub
I'm working on a side project using MuiTable, and all the fonts are defaulted to Roboto :( I am using react-starter-kit and have...
Read more >Overwrite Material UI 5.0 typography theme globally with ...
I'd like to apply them globally by overwriting the theme . My first issue is that I can't get the fonts to even...
Read more >Typography doesn't work (global settings are overriding it)
I need help regarding the customizer (site settings). The global typography setting is overriding the regular typography setting.
Read more >Typography - Material UI - MUI
Typography. The theme provides a set of type sizes that work well together, and also with the layout grid. Font family. You can...
Read more >Typography | Webflow University
It's common to use this technique to set global font styles on the body tag, to align text and other elements inside of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mrmadhat Both approaches should work:
But notice that the “h2” approach is significantly slower, at least, until we solve a core issue with the styling solution.
@oliviertassinari thankyou for your help, what I have now is:
Which works as expected, is there a better way to accomplish this? Could you possibly provide an example?