Reputation: 1875
Is it possible to achieve Retina-quality CSS masking using -webkit-mask-box-image
? In this particular case, I am trying to round the corners of an element (border-radius
is not performant enough):
.element {
-webkit-mask-box-image: url('mask.png') 12 12 12 12 stretch stretch;
}
The mask image is twice the size that it needs to be (6
is used in place of 12
for non-retina screens).
The mask is correctly positioned, but the corner rounding is not Retina-smooth.
Upvotes: 1
Views: 1448
Reputation: 32103
I see three solutions, here:
-webkit-mask
, so unless you're making a Chrome app, you're losing a lot of your audience (currently about 54.25%) to browser incompatibility, not to mention that it requires the user to download an image just to see rounded corners.Upvotes: 1