question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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.

  1. Create a new Component (I am making a menu) which adds child items recursively (which are different components)
  2. Change Background color and color (text color) of parent component
  3. 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
leMaikcommented, Feb 6, 2018

@sambhav-gore

When I am working on a customised design, I am finding myself writing color=“inherit” on Many of the Typography elements across components.

You could create a very simple wrapper for that: const InheritColorTypography = (props) => <Typography color="inherit" {...props} />

0reactions
sambhav-gorecommented, Feb 6, 2018

Thank you for consideration and the alternate solution is fine with me.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found