question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mask-image and gradients

See original GitHub issue
mask-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 standard at 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:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, May 13, 2018

Done 847bfd5

0reactions
BaliBalocommented, May 28, 2018

Thanks a lot! Haven’t had time to make a PR sorry.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found