I’ve tried to create a curved box using mask-image
property. I’ve achieved what
i need but the issue is that the corner looks pixelated. Any solutions for this.
.shape {
width: 50px;
height: 50px;
background: #f00;
mask-image: radial-gradient( circle 100px at 0 0, transparent 0, transparent 50px, black 21px);
}
<div class="shape">
</div>
Here is the code
.shape{
width: 50px;
height: 50px;
background: #f00;
mask-image: radial-gradient(
circle 100px at 0 0,
transparent 0,
transparent 50px,
black 21px
);
}
2
Answers
The solution is to use SVG as svgs don’t rely on pixels like mask-image does, it relies on math/geometry. see vector graphics to understand.
The thing is that you will have to create the svgs or use from the web
You can "smooth" the gradient: