css – 类材料ui中的样式元素

是否可以在材质中为网格内的所有字段设置样式-ui?
我已经知道如何在CSS中做到这一点,但我无法在jss中找到如何做到这一点
我试过这个但不行:

const styles = {
      shopForm: {
    textAlign : 'center',Field :{
        width: '60%'
     }};

我该如何改变风格?
这种风格可以在jss中使用吗?
在css过去这样做:

.shopForm Field
{...}

我正在使用材料-ui

<Grid item lg={4} className={classes.shopForm}>
                        <Field
                            name="name"
                            type="text"
                            label="name"
                            component={TextField}
                        />
                        <Field
                            name="plaque"
                            type="text"
                            label="plaque"
                            component={TextField}
                        />
                        <Field
                            name="unit"
                            type="text"
                            label="unit"
                            component={TextField}
                        />
                        <Field
                            name="text"
                            type="text"
                            label="text"
                            component={TextField}
                            multiline
                            row={3}
                        />
                    </Grid>

解决方法

一段时间后找到某种答案!
样式字段组件本身是不可能的,因为它由其他元素组成,但您可以设置在materialUI组件内的元素:

shopForm: {
    textAlign : 'center','& input' :{
    width: '60%',color:'grey'
   },'& label':{
  fontSize:'15px'
}

因此,您必须首先找到要设置样式的元素,然后将样式赋予父类.

<Grid item lg={4} className={classes.shopForm}>
                    <Field
                        name="name"
                        type="text"
                        label="name"
                        component={TextField}
                    />
                    <Field
                        name="plaque"
                        type="text"
                        label="plaque"
                        component={TextField}
                    />
                    <Field
                        name="unit"
                        type="text"
                        label="unit"
                        component={TextField}
                    />
                    <Field
                        name="text"
                        type="text"
                        label="text"
                        component={TextField}
                        multiline
                        row={3}
                    />
</Grid>

相关文章

Css常用的排序方式权重分配 排序方式: 1、按类型&#160;...
原文:https://www.cnblogs.com/wenruo/p/9732704.html 先上...
css属性:word-wrap:break-word; 与 word-break:break-all 的...
https://destiny001.gitee.io/color/
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML...
css之background的cover和contain的缩放背景图 对于这两个属...