mask-image and gradients
See original GitHub issuemask-image: radial-gradient(circle closest-corner at 100% 50%, #000, transparent);
outputs the following
-webkit-mask-image: -webkit-radial-gradient(circle closest-corner at 100% 50%, #000, transparent);
mask-image: radial-gradient(circle closest-corner at 100% 50%, #000, transparent);
This is wrong because:
- The prefixed version of
radial-gradient
uses an old syntax (-webkit-radial-gradient(100% 50%, circle closest-corner, ...)
), the standardat 100% 50%
is not recognized, so the first line doesn’t work. - Webkit doesn’t support the unprefixed
mask-image
, so the second line doesn’t work.
One thing that would work would be the prefixed version of mask-image with the unprefixed version of radial-gradient: -webkit-mask-image: radial-gradient(circle closest-corner at 100% 50%, #000, transparent);
(I am testing in Chrome, not sure if this applies in Safari)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Masking Images in CSS Using the mask-image Property
A quick tutorial with examples on how to use image, gradient and SVG masks in CSS.
Read more >mask-image - CSS: Cascading Style Sheets - MDN Web Docs
The mask-image CSS property sets the image that is used as mask layer ... <image> values */ mask-image: linear-gradient(rgba(0, 0, 0, 1), ...
Read more >CSS Masking - The mask-image Property - W3Schools
The CSS mask-image property specifies a mask layer image. The mask layer image can be a PNG image, an SVG image, a CSS...
Read more >Apply effects to images with CSS's mask-image property
Using a CSS gradient as your mask is an elegant way of achieving a masked area without needing to go to the trouble...
Read more >Using CSS, can you apply a gradient mask to fade to the ...
Here's how you can do it using modern mask-image and linear-gradient properties. Sadly ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Done 847bfd5
Thanks a lot! Haven’t had time to make a PR sorry.