.dice {
margin: 4.5px auto;
width: 40px;
height: 34px;
border: 1px solid black;
border-radius: 9px;
background-color: ghostwhite;
transition: 900ms ease all;
text-align: center;
line-height: 10px;
padding-top: 5px;
}
<div class="dice">1</div>
<div class="dice" id="rotated" onclick="this.style.transform = 'rotate('+ (1*-90) +'deg)';">2</div>
I have this dice that I want to rotate 90 degrees (click '2'). It has a border radius that looks fine before the transform rotate but looks messy afterwards. Especially the curved edges are smudgy in FF after the transform.
Here's an image that should illustrate the issue, top left dice has jagged/anti-aliassed borders. image
[Appearntly embedding images is hard]
Here's an example, although it might be a bit hard to see: https://jsfiddle.net/39m2wqua/
I've read some posts about subpixel/halfpixel rendering, tried adding a shadow-box, or translateZ(1px) to the transform but nothing seems to fix this. Here's a similar thread: Anti-aliasing on rotated div with border image in firefox