Im using material ui with react. Im a beginner. Two questions:
How do I set the TextFields (the TextFields in the form) color to be white. The placeholder is currently black, so it the text when i write in it. I have tried to use makeStyles and set the color to white, but cant get it to work.
How do I set the backgroundcolor with material ui instead of doing it directly in the css. I have tried theming but that too doesnt work. I feel like setting it using material ui will make the page more dynamic, or is that just not the way of doing it?
I have struggeled with this for days, and im probably doing something wrong. So, I need help.
A link to how the site looks right now
Here is the code. Its not much:
App.js:
import { makeStyles } from "@material-ui/core/styles";
import { Grid, TextField, Button, Typography } from "@material-ui/core";
function App() {
const useStyles = makeStyles((theme) => ({
textField: {
width: "100%",
},
}));
const classes = useStyles();
const handleSubmit = (e) => {
e.preventDefault();
console.log("Hi");
};
return (
<>
<Grid container spacing={3}>
<Grid item xs={6}></Grid>
<Grid item xs={6} sm={6}>
<Typography variant="h2" color="primary">
Some information about you
</Typography>
<form onSubmit={handleSubmit}>
<TextField
label="Name"
variant="filled"
className={classes.textField}
></TextField>
<TextField
label="Phone Number"
variant="filled"
className={classes.textField}
></TextField>
<Button
type="submit"
value="Submit"
color="primary"
variant="contained"
>
Submit
</Button>
</form>
</Grid>
</Grid>
</>
);
}
export default App;
Css:
body {
margin: 0;
background-color: #39445a;
}