Material-ui: Override label + .MuiInput-formControl

Created on 30 Apr 2018  路  3Comments  路  Source: mui-org/material-ui

Is there anyway to override the following style?

label + .MuiInput-formControl-21 {
    margin-top: 16px;
}

I tried overriding it with:

MuiInput: {
  formControl: {
    marginTop: '0px'
  }
}

But 'label + .MuiInput-formControl-21' style will always override my override.

Is there anyway to add the 'label +' part of the css into my theme object?

I read through the JSS docs, and tried doing this with no luck:

'label + MuiInput': {
  formControl: {
    marginTop: '0px'
   }
}

Not quite sure where the element+element selector should go.

I am trying to put the label inside of the form field while maintaining effects, and this is the only style that's left for me to change in order to do that.

| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-beta.43 |
| React | 16.3 |
| browser | Chrome 65.0.3325.181 |

support

Most helpful comment

All 3 comments

馃憢 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.

Fantastic, thank you so much for replying quickly!

Solved with the following:
MuiInput: { formControl: { 'label + &': { marginTop: '0px' } } }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbozan picture rbozan  路  3Comments

sys13 picture sys13  路  3Comments

TimoRuetten picture TimoRuetten  路  3Comments

reflog picture reflog  路  3Comments

ericraffin picture ericraffin  路  3Comments