Can someone help me achieve a hover effect similar to the one in this question on Stack Overflow: Hover effect : expand bottom border
I am attempting to create the same effect in React using makeStyles of Material UI. Here is my current code:
const useStyles = makeStyles((theme) => ({
//other code
remove: {
textTransform: "none",
fontSize: "0.75rem",
"&:after": {
transition: theme.transitions.create(["transform"], {
duration: theme.transitions.duration.standard,
}),
transform: "scale(0)",
borderBottom: "1px solid #dbdada",
transformOrigin: "0% 50%",
},
"&:hover": {
background: "none",
"&:after": {
transform: "scale(1)",
},
},
},
// other code
}));
This is the component where I am trying to implement the border bottom animation:
<Button
classes={{root:classes.remove}}
onClick={() => handleClickRemove(item)}
>
Remove
</Button>