ARTICLE AD BOX
When hovering over the nav links at the top, an underline effect is animated (through transition). During that brief 0.2s transition, the pink text "ABC" in the lower corner of the cards appear to momentarily reduce the font weight. If I remove the box-shadow from the card class, the visual glitch goes away.
This happens in chrome and Edge, but not Firefox. So I'm thinking some kind of chromium rendering bug.
While not game-breaking, it is an unwanted side-effect. Does anyone have any insight or solution?
edit: The visual bug was apparent in the code preview on this page, but viewing it embedded it doesn't happen. So here's a fiddle just in case: https://jsfiddle.net/yjf80Lrv/
5
Adding will-change:transform to the effected element fixes the "shifting" of the text. But this basically turns off the subpixel AA, making the text look like that lighter weight appearance. The fix below comes from copilot, scaleX() was the root cause. It forces GPU promotion which forces text re-rasterization which changes antialiasing which caused the text to appear lighter. Switching the animation from using transform to width then the browser no longer needs to promote layers and the text stays as it is.
I'm not even going to pretend I fully understand that, but it worked. Hate to admit it but AI gets +1
2,0762 gold badges12 silver badges26 bronze badges
Explore related questions
See similar questions with these tags.

