Material-ui: [TextField] CSS API missing

Created on 12 Jul 2019  路  4Comments  路  Source: mui-org/material-ui

  • [x] This is not a v0.x issue.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 馃

Show CSS API like https://material-ui.com/api/input-label/#css

Current Behavior 馃槸

CSS API missing

Steps to Reproduce 馃暪

https://material-ui.com/api/text-field/#css

Context 馃敠

I wanted to look up how to pass down a class to the helper Text

Your Environment 馃寧

Online Documentation

| Tech | Version |
|--------------|---------|
| Material-UI | v4.2.0 |

TextField docs good first issue

Most helpful comment

I got this one 馃憤

All 4 comments

This component doesn't inject any styles. The simplest strategy is to open the dev tools, and to pick the global class name.

OK then, but shouldn't we at least say that in the docs then? I was passing stuff to classes and got the error "Only root is available" - so should we then at least list that under CSS API?


On the other hand it would be great if you _could_ pass down classes.
My workaround is now passing a class down to classes={{ root: classes.helperText }} and then having

helperText: {
  '& p': {
    //my overwrites here
  }
},

Oh, I was wrong. Thanks for raising that the root key was working. I had forgotten that we introduced it for global theme overrides.
https://github.com/mui-org/material-ui/blob/22ba481fd549ffd35199846d2c313881406256a4/packages/material-ui/src/TextField/TextField.js#L21

Ok, in this case, I think that we should export the style const so the API generator can pick it up:

-const styles = {
+export const styles = { 

I got this one 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gndplayground picture gndplayground  路  54Comments

kybarg picture kybarg  路  164Comments

mnajdova picture mnajdova  路  105Comments

damianobarbati picture damianobarbati  路  55Comments

illogikal picture illogikal  路  75Comments