Change Request - Set typography color default to `inherit`
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
This is a change request.
In My opinion, it would be helpful if the color
prop of Typography is set to inherit
by default.
It would also match expectation that when I set a color on a parent component then all children inherit the color (unless overridden).
Additionally, it would be awesome if this could be done for Icons
as well.
Current Behavior
When I am working on a customised design, I am finding myself writing color="inherit"
on Many of the Typography
elements across components.
- Create a new Component (I am making a menu) which adds child items recursively (which are different components)
- Change Background color and color (text color) of parent component
- Child components should have
Typography
elements.
Now even though the color is explicitly defined in parent component, still typography needs to have a prop.
Context
Having to specify color prop many times.
Your Environment
Tech | Version |
---|---|
Material-UI | |
React | |
browser | |
etc |
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Change Request - Set typography color default to `inherit ...
Expected Behavior This is a change request. In My opinion, it would be helpful if the color prop of Typography is set to...
Read more >Set Typography text color in MUI - reactjs
If you want to set a default color for all Typography elements, but not for other Material UI elements you can try this:...
Read more >Please change text element defaults to "inherit" theme ...
Currently, when adding a new text element to a page, it inherits the font-family and text-align properties, but beyond that, there are a...
Read more >Typography API - Material UI
API reference docs for the React Typography component. ... The name MuiTypography can be used when providing default props or style overrides in...
Read more >Text style inheritance overview
You can override this inherited text styling by selecting one of the text elements and changing the font-family. You will then see a...
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
@sambhav-gore
You could create a very simple wrapper for that:
const InheritColorTypography = (props) => <Typography color="inherit" {...props} />
Thank you for consideration and the alternate solution is fine with me.