我正在学习Material UI,想要放大页面上的文本框。但是,我嵌入到文本框的样式会改变高度、宽度和其他属性,除了大小。以下是我的代码:
const styles = {
container: {
display: 'flex',
flexWrap: 'wrap',
},
textField: {
// marginLeft: theme.spacing.unit,
// marginRight: theme.spacing.unit,
width: 300,
margin: 100,
fontSize: 50 //??? Doesnt work
}
}
下面是无状态组件(React):
const Searchbox = (props) => {
const { classes } = props;
return (
<TextField
onKeyDown={props.onKeyDown}
id="with-placeholder"
label="Add id"
placeholder="id"
className={classes.textField}
margin="normal"
autoFocus={true}
helperText={"Add an existing id or select "}
/>
);
};
export default withStyles(styles)(Searchbox);
我完全理解这并不是什么高深的技术,只是一种直接在JS中应用CSS样式的方法。
但是,我不能覆盖我的文本字段的基础字体大小。希望能得到任何帮助。