How can i "crop" the svg filter to fit the shape of the parent?
Right now I have a div as a circle, with an svg in it. But the svg filter creates an rectangel.
Edit: I tried to implement a wrapping div with border-radius:100% as suggested below, but then it removes the blur.
updated codepen with wrapping div
svg{
width:100%;
height: 100%;
}
.custom-cursor {
border-radius: 50%;
overflow: hidden;
width: 20px;
height: 20px;
background-image: conic-gradient( cyan, magenta, yellow, cyan);
filter: blur(5px) url("#blur-plus-grain");
}
<div class="custom-cursor">
<svg preserveAspectRatio="none">
<filter id="blur-plus-grain">
<feGaussianBlur stdDeviation="0.8" result="blur" />
<feTurbulence type="fractalNoise" numOctaves="26" baseFrequency="40" stitchTiles="stitch" result="grain" />
<feComposite operator="in" in="blur" in2="grain" />
</filter>
<circle fill="transparent" r="10" cx="50%" cy="50%" filter="url(#blur-plus-grain)" />
</svg>
</div>


