[docs] Document how to chain in createTheme
See original GitHub issueWhen using createMuiTheme
, along with overrides
, we lose the context of the theme we customizing.
Here’s a quick codesandbox which demonstrates the issue and also the desired (optional) solution:
https://codesandbox.io/s/jolly-aryabhata-8q37p
const theme = createMuiTheme({
shape: {
borderRadius: 4
},
overrides: {
MuiChip: {
root: {
borderRadius: 4
}
}
}
// this is what I would want
// overrides: (theme) => ({
// MuiChip: {
// root: {
// borderRadius: theme.shape.borderRadius
// }
// }
// })
});
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:18 (13 by maintainers)
Top Results From Across the Web
[docs] Document how to chain in createTheme #21757 - GitHub
When using createMuiTheme , along with overrides , we lose the context of the theme we customizing. ... const theme = createMuiTheme({ shape:...
Read more >Creating and applying themes for embedded dashboards and ...
To see what's new, check in with the Custom theme settings section below, or check the Create Theme API documentation page for the...
Read more >Add a title, heading, or table of contents in a document
Make a title or heading · On your computer, open a document in Google Docs. · Select the text you want to change....
Read more >Creating a custom HTML theme - Tumblr
Click the name of your blog at the top of the Dashboard or under the list icon at the top. Click “Customize” on...
Read more >Creating and using themes | Adobe Experience Manager
Navigate to Forms & Documents > Themes, and select a theme and open it. The theme opens in the Theme Editor. As discussed...
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
Ok, so unless somebody wants to bring in new arguments, the best option we have identified is:
I think that we should document it.
For instance, we use it here: https://github.com/mui-org/material-ui/blob/HEAD/docs/src/modules/branding/BrandingRoot.tsx.
TODO
Not to me. Going with “make senses” or “common sense” is usually a fallacy because it requires some knowledge. For a new user it’s unclear why some key in an object should be treated differently. Maybe it never will. Requiring that insight to make sense of an API does not make for a good API.
The example doesn’t require any special API or type overloading:
Variant A
Variant B
Convenience API should have a very high barrier to implement because it’s just convenience.