I'm beginner in ReactJS and I'm using materia-ui to create a page.
I need to do a custom on a TextField, I'd like to change the font-size when the input field is filled with some text. When I change the font-size, there is a very large space between the label and the border-bottom of the Input field. So I need to change the font-size only when the Input field is filled.
Could u tell me how can I do that?
Here's my code I put into codesandbox
import React from "react";
import * as S from "./styles";
export default function App() {
return (
<div className="App">
<S.Input label="Name" variant="standard" />
</div>
);
}
import styled from "styled-components";
import { TextField } from "@mui/material";
export const Input = styled(TextField)`
&& {
.MuiInputBase-root {
font-size: 30px;
}
}
`;
Thank you very much for any help.



