satori icon indicating copy to clipboard operation
satori copied to clipboard

Error with linear-gradient

Open edwardhorsford opened this issue 1 year ago • 2 comments

Bug report

I'm using Satori by way of the Eleventy OG plugin.

Description / Observed Behavior

I'm getting an error with the following css:

background-image: linear-gradient(
      to bottom right,
      transparent 50%,
      #e70565 50%
    ),
    linear-gradient(#e70565, #e70565),
    linear-gradient(to top left, transparent 50%, #e70565 50%);
  background-repeat: no-repeat;
  background-size: 10px 68%, calc(100% - 20px) 68%, 10px 68%;

The error is: e70565, #e70565): Missing comma before color stops

Confusingly, the same css with a different colour does not error:

background-image: linear-gradient(
          to bottom right,
          transparent 50%,
          #b393d3 50%
        ),
        linear-gradient(#b393d3, #b393d3),
        linear-gradient(to top left, transparent 50%, #b393d3 50%);
      background-repeat: no-repeat;
      background-size: 10px 68%, calc(100% - 20px) 68%, 10px 68%;

however, it does not render correctly: Screenshot 2024-01-09 at 14 38 10

Expected Behavior

When rendered on screen (not Satori), these linear gradients add up to look like this: Screenshot 2024-01-09 at 14 37 10

Reproduction

Error with color stops No error, but rendering incorrectly

edwardhorsford avatar Jan 09 '24 15:01 edwardhorsford

this errors for me as well:

background: 'linear-gradient(0.05turn, #6c47d7 5%, #1e1f21 70%)',

I get:

 Error: .05turn, #6c47d7 5%, #1e1f21 70%): Missing comma before color stops

CryptoGraffe avatar Jan 11 '24 06:01 CryptoGraffe

I was having the same issue with this gradient: linear-gradient(#0B1C31, #1E67B7)

I fixed it by prepending the direction: linear-gradient(to bottom, #0B1C31, #1E67B7)

itsjavi avatar Mar 18 '24 13:03 itsjavi

@CryptoGraffe @itsjavi #624 will fix your problems once merged

Jackie1210 avatar Jun 22 '24 03:06 Jackie1210