Is is possible to use dynamic styles in the MUI sx prop? Something like this:
<Box
key={index}
sx={{
height: "100%",
width: "100%",
{index === imgIndex &&
{"@keyframes fadeIn": {
from: {
opacity: 0,
},
to: {
opacity: 1,
},
},
"fade-in": {
animation: "$fadeIn 2.5s",
}}}
}}
>
{child}
</Box>
If not, what options are there to do something like this?
My use case is this is a refactor of a carousel that was done with MUI4 (makeStyles) and I'm migrating to MUI5 (no more makeStyles)