I have svg that I apply 2 colors through props one for background works and the other for fill doesn't. I'm using Next.js.
export default function Divider({
topColor,
bottomColor,
}: {
topColor: string;
bottomColor: string;
}) {
return (
<svg
data-name="Layer 1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1200 120"
preserveAspectRatio="none"
className={`bg-${bottomColor}`}
>
<path
d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z"
className={`fill-${topColor}`}
></path>
</svg>
);
}
<Divider topColor="cyan-950" bottomColor="slate-50" />
Strange thing is I can see class being applied in dev tools class="fill-cyan-950"
but as you can see in the image above it doesn't show on the screen (it's black should be dark blue/green). If I do it explicitly in the code without props it works as intended.