Material-ui: Overriding MuiFormHelperText style

Created on 20 Nov 2018  路  3Comments  路  Source: mui-org/material-ui

I tried to override MuiFormHelperText styles in theme.

This is what I did in theme:

    MuiFormHelperText: {
        root: {
            color: colorCodes.darkGrey
        },
        error: {
            color: colorCodes.darkGrey
        }
    },

However the color was not changed on page.

I view the css in Chrome and found:

.MuiFormHelperText-root-389.MuiFormHelperText-error-390 {
    color: #f44336;
}

Looks like the generated version is missing a space between these two classes so I cannot change the color or other styles of this label.
Same issue with the "required" * star in label.

Please look into it.

Thanks
CJ

TextField support

Most helpful comment

Have you tried

MuiFormHelperText: {
    root: {
    color: colorCodes.darkGrey,
        "&$error": {
         color: colorCodes.darkGrey
    }
    },
},

?

All 3 comments

Have you tried

MuiFormHelperText: {
    root: {
    color: colorCodes.darkGrey,
        "&$error": {
         color: colorCodes.darkGrey
    }
    },
},

?

馃憢 Thanks for using Material-UI!

We use the issue tracker exclusively for bug reports and feature requests, however,
this issue appears to be a support request or question. Please ask on StackOverflow where the
community will do their best to help. There is a "material-ui" tag that you can use to tag your
question.

If you would like to link from here to your question on SO, it will help others find it.
If your issues is confirmed as a bug, you are welcome to reopen the issue using the issue template.

@eps1lon Thank you, your solution worked 馃挴

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reflog picture reflog  路  3Comments

ghost picture ghost  路  3Comments

ericraffin picture ericraffin  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

FranBran picture FranBran  路  3Comments