0

.lighting {
width: 100%;
height: 100%;
position: absolute;
z-index: 8;
opacity: 0.3;
-webkit-mask-image: gradient(linear, left 50%, left 60%, from(rgba(0,0,0,1)), to(rgba(0,0,0,1)));
mask-image: gradient(linear, left 50%, left 60%, from(rgba(0,0,0,1)), to(rgba(0,0,0,1)));
mix-blend-mode: screen;
pointer-events: none;
filter: blur(3px);
}

.sunMask {
position:absolute;
width:100%;
height:100%;
-webkit-mask-image: gradient(linear, left 50%, left 60%, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
mask-image: gradient(linear, left 50%, left 60%, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
z-index: 4;
mix-blend-mode: screen;
animation-name: sunFocus;
}

This code does not work in Firefox more accurately with -web-web-mask-image and mask-image values. I haven't found a solution to this problem on the Internet, so I ask here. In Firefox console you can see only:

Error when processing values for "mask-image". Declaration abandoned. 
Error while processing values for "-webkit-mask-image". Declaration abandoned.
Majonez.exe
  • 412
  • 8
  • 22

1 Answers1

0

As commented you gradient syntax is wrong. If you check the specification of mask you will find this:

<mask-layer> = <mask-reference> || <position> [ / <bg-size> ]? ||<repeat-style> || <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator> || <masking-mode>

Then

 <mask-reference> = none | <image> | <mask-source>

Then

<image> = <url> | <gradient>

Then

<gradient> =
<linear-gradient()> | <repeating-linear-gradient()> |
<radial-gradient()> | <repeating-radial-gradient()>

and finally

linear-gradient() = linear-gradient(
 [ <angle> | to <side-or-corner> ]? ,
 <color-stop-list>
)
<side-or-corner> = [left | right] || [top | bottom]

Example:

.lighting {
  width: 100%;
  height: 100%;
  position: absolute;
  -webkit-mask-image: linear-gradient(to left,transparent, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 1) 60%,transparent);
  mask-image: linear-gradient(to left,transparent, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 1) 60%,transparent);
  background:blue;
}

.sunMask {
  position: absolute;
  width: 100%;
  height: 100%;
 -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 60%);
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 60%);
  background:green;
}

body {
  background:red;
  margin:0;
}
<div class="lighting">

</div>

<div class="sunMask">

</div>
Temani Afif
  • 245,468
  • 26
  • 309
  • 415