Subpixel rendering is the key factor here. When using a 13px font-size at the html level, the width and height adjust to 9.75px
.
To solve this issue, one should opt for a larger value and then scale it accordingly.
Check out the Demo
In my case, I utilized w-6 h-6 ring-8 scale-50
instead of w-3 h-3 ring-4
, which resulted in a perfect display.
html {
font-size: 13px;
}
<script src="https://cdn.tailwindcss.com"></script>
<div class="w-screen h-screen bg-neutral-50">
<header class="flex flex-row bg-white p-6">
<div class="flex-1 flex flex-row justify-end space-x-2">
<div class="relative inline-block">
<div class="w-12 h-12 bg-gray-100 rounded-full"></div>
<div class="w-6 h-6 scale-50 bg-red-500 rounded-full ring-8 ring-white absolute top-0 right-0 origin-top-right"></div>
</div>
<div class="relative inline-block">
<div class="w-12 h-12 bg-gray-100 rounded-full"></div>
<div class="w-6 h-6 scale-50 bg-red-500 rounded-full ring-8 ring-white absolute top-0 right-0 origin-top-right"></div>
</div>
<div class="relative inline-block">
<div class="w-12 h-12 bg-gray-100 rounded-full"></div>
<div class="w-6 h-6 scale-50 bg-green-500 rounded-full ring-8 ring-white absolute bottom-0 right-0 origin-bottom-right"></div>
</div>
</div>
</header>
</div>
Explore the Related Answer