Re: [csswg-drafts] [css-images-4] Clarifying CSS gradient rendering for edge cases involving "longer hue" interpolation (#11381)

I'm worried that this will break the compatibility of the site.

Currently, there are many places that use `longer hue` to create a rainbow gradient.

```css
.foo {
  background: linear-gradient(to right in hsl longer hue, red 0 0);
}
```

- https://stackoverflow.com/a/75923874/7983605
- https://x.com/jh3yy/status/1879320099858825216
- https://nerdy.dev/easy-hsl-rainbow#:~:text=It%20means%20you%20can%20also%20do%20the%20following
![Image](https://github.com/user-attachments/assets/f937f928-c681-479d-9a5f-a80bf1be94de)


With this proposed change, this fails to produce a gradient and will only show up as a red background.

This breaks compatibility with existing sites and CSS authors must change the CSS above to:

```css
.foo {
  background: linear-gradient(to right in hsl longer hue, red 0 100%);
 /* or */
  background: linear-gradient(to right in hsl longer hue, red, red);
}
```

So, can we relax the restriction so that a gradient can be generated when there is only one color stop.

cc @LeaVerou 

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


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

Received on Wednesday, 12 February 2025 03:45:00 UTC