Pet*_*elt 3 javascript reactjs material-ui
我只是想不通伙计们。我想用我的文本字段更改标签的字体大小。到目前为止,我只能更改输入的字体大小,而不能更改标签。
文本域:
<TextField
className={classes.TextField}
id="input-with-icon-textfield"
label="Zoeken"
InputProps={{
startAdornment: (
<InputAdornment position="start">
<Search />
</InputAdornment>
),
}}
onChange={(e) => {this.setTextFilter(e.target.value);}}
/>
Run Code Online (Sandbox Code Playgroud)
添加了一张图片,以便您可以通过标签了解我的意思。
这里的另一个选项:安装覆盖,您可以将其用作标签道具内的版式组件。参见示例
<TextField
label={
<Typography variant="headline" component="h3"> Zoeken </Typography>
} ..../>
Run Code Online (Sandbox Code Playgroud)
希望这会对某人有所帮助。
我最终在我的主要 mui 主题中添加了一些代码。
const theme = createMuiTheme({
palette: {
primary: {
main: '#39870c',
ligth: '#6cb842',
dark: '#005900'
},
secondary: {
light: '#01689b',
main: '#0044ff',
contrastText: '#ffcc00',
},
},
overrides: {
MuiInputLabel: {
root: {
color:'black',
fontSize: 13,
},
},
}
});
Run Code Online (Sandbox Code Playgroud)
通过覆盖,我基本上可以改变任何东西。我希望这对将来的人有所帮助,因为这真的很烦人。
| 归档时间: |
|
| 查看次数: |
6602 次 |
| 最近记录: |