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.

[DialogTitle]Any way to change the DialogTitle (h2) style?

See original GitHub issue

When applying style to the classes attribute using the root key, it can’t work since the component create an h2 tag internaly with a black color (the color injected thought the root key is applied to its parent).

  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

When injecting a color to the DialogTitle component (though the classes.root property or a JSS className), i need it to not be overrided.

Current Behavior

When injecting a color to the DialogTitle component (though the classes.root property or a JSS className), it is applied to the parent but an h2 tag with a black color overrides it.

Your Environment

Tech Version
Material-UI v1.0.0

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
mbrookescommented, May 23, 2018

You can use the disableTypography property and provide your own.

4reactions
lkritikoscommented, Feb 17, 2022

I’ve also run into this issue, since I would like to be able to use component='h1' without running into linting issues (invalid prop type). component='h1' works, since it’s indirectly supported in the code (via ...other), but it’s kind of a hacky way of going about this and, in my case, requires a ts-ignore.

Since DialogTitle is a styled Typography component, why do we currently limit the Typography props that can be changed on it? Just curious about the design decision here. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I change font color in DialogTitle and DialogContent ...
The easiest way to do this is just to create a new component and add custom styles to it.
Read more >
DialogTitle API - Material UI - MUI
API reference docs for the React DialogTitle component. ... The name MuiDialogTitle can be used when providing default props or style overrides in...
Read more >
ARIA: dialog role - Accessibility - MDN Web Docs - Mozilla
The best way to achieve this is by using the aria-labelledby ... updated</h2> <p id="dialog1Desc"> You can change your details at any time ......
Read more >
React MUI DialogTitle API - GeeksforGeeks
root (MuiDivider-root): It is the style applied to the root element. Approach: Let us create a React project and install React MUI module....
Read more >
Dialog | Angular Material
A dialog is opened by calling the open method with a component to be loaded and ... [Attr] Dialog title, applied to 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