How to use and override themes with hooks
See original GitHub issueHey!
I’m struggling in properly using and overriding themes. I want to use the default theme with some custom overrides (e.g. different font size).
Example: https://codesandbox.io/s/j7owzjlnqv
"react": "16.8.0-alpha.1",
"react-dom": "16.8.0-alpha.1",
"react-scripts": "2.1.3",
"@material-ui/core": "3.9.0",
"@material-ui/styles": "^3.0.0-alpha.8"
With typescript, I cannot seem to use createMuiTheme
from @material-ui/core/styles
as importing it gives a conflict between jss@9
and jss@10
(latter is used by @material-ui/styles
)
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
How to use and override themes with hooks #14217 - GitHub
Hey! I'm struggling in properly using and overriding themes. I want to use the default theme with some custom overrides (e.g. different font ......
Read more >How to use hooks in child theme to override a plugin?
1 Answer 1 ... you can't really override a function like that. you can only use the filters and hooks that the plugin...
Read more >A Guide to Overriding Parent Theme Functions in Your Child ...
In this tutorial, I'll show you three methods you can use to override functions from the parent theme in your child theme:.
Read more >Override Plugin Function with Hooks - WordPress.org
I have a function that I need to override to change the translation. I can't just translate it through strings with WPML of...
Read more >Allow theme hooks to override module hooks [#3178013]
When using the preprocess module, the hook within the src/Plugins/Preprocess fires *after* the hook in the theme is processed.
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 Free
Top 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
This is a common confusion.
ThemeProvider
is a generic theme provider. It does not automatically include the material-ui theme. You have to explicitly use it:~@skoging Seems like you posted in the wrong issue. This is basically what I outlined in https://github.com/mui-org/material-ui/issues/14297#issuecomment-458508064~
The issue with typescript and conflicting jss types is continued in #14297. Usage issue seems resolved with https://github.com/mui-org/material-ui/issues/14217#issuecomment-455174494