Is it wrong to use the mask-image property? Is it obsolete?
I've been learning how to use the mask-image property but without the -webkit- prefix it doesn't work in Chrome.
11 Replies
it is not obsolete chrome for some reason requires the use of the webkit instead of the normal one
Are there other properties that also only work in Chrome using the prefix? Common Properties
the one that comes to mind is for styling scrollbars
and that's all chromium based browsers not just chrome 🙂
when in doubt, you can always check caniuse.com https://caniuse.com/mdn-css_properties_mask-image
personally, if i was you, i would use clip-path instead
I have a bunch of clip paths ready to go, including a heart https://codepen.io/z-/pen/VwEPZjr
and you can change them at will, without having to upload new images
in fact, i would even use an svg for this, so everything is still a single image
oh, and you can transition between 2 clip-paths with the polygon function
FYI
mask-image
is part of Interop2023 so should finally be cross browser consistent without prefixes by the end of the year. Chrome just started working on it this week.but according to mdn, clip-path is more efficient than mask-image, which is one of the reasons why i recommended it (although i didnt mention this before)