Re: [csswg-drafts] [css-images-4] Allow stripes to be used as gradients (#7244)

> background-image: linear-gradient(45deg, black, stripes(red, yellow, lime, blue) 100px, white);

I actually skipped over this example, sorry. Now I'm not at all sure what it's actually supposed to be doing. That middle argument appears to be expecting the 100px to be a width, rather than a position (which is what all other lengths in a gradient are). How is that meant to mix with the other stops?

I'd assumed that the option 1 was about allowing `<1d-image>` as an *alternative* to the `<color-stop-list>` production. That is straightforward to define (tho it's still nesting functions). I'm just not sure what exactly you're expecting with your more complex example. I think *at best* you'd have to write that as:

```
linear-gradient(
  45deg,
  black,
  stripes(red, yellow, lime, blue) calc(50% - 50px) calc(50% + 50px),
  white
);
```

That is, the 1d-image would have to be paired with a double-position, and it defines the color within that range (using the range's size as the background painting area, basically).

The important question here, tho, is: how much do we expect this sort of thing to actually occur, such that it's worthwhile to add this additional complexity? Complex gradients *can* be a little verbose to define already; is that stopping people from using gradients in those cases? Do we have reason to believe that *this type* of complex gradient is something authors want to use a lot, so they'd benefit from making it easier?

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7244#issuecomment-1696206636 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 28 August 2023 18:51:59 UTC