I want to do something like this:
I want a border-radius
, transparency
(to see the background), and the possibility to fill from 0% to 100% the border
.
For the moment, I have this code:
body{
background: lightgrey;
}
.avatar{
padding: 10px;
display: inline-block;
position: relative;
z-index: 0;
}
.avatar:before{
width: 180px;
aspect-ratio: 1;
content: "";
position: absolute;
z-index: -1;
inset: 0;
padding: 8px;
border-radius: 100%;
background: linear-gradient(to top, transparent 25%, blue 25%, blue);
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: clear;
mask-composite: clear;
}
<html>
<body>
<div class="avatar"></div>
</body>
</html>
How is it possible to fill X% of the border?
Thank you!