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

> You say "many sites" are relying on this to generate rainbows, but I don't actually see rainbows very much in practice on the web. Is this just a cute CSS trick that has gotten some shares, or do we have evidence it's _actually_ used in a non-trivial number of sites (and, ideally, have evidence that rendering them as a solid color would actually harm the rendering, rather than just _change_ the rendering)?

FWIW, we [fixed this gradient-rendering behavior](https://bugzilla.mozilla.org/show_bug.cgi?id=1939948) in Firefox 136 (currently in Beta), so that the regions before the first and after the last color stops now render solid colors, not an "extra" full-cycle gradient. This also means, of course, that `linear-gradient(in hsl longer hue, red 0 0)` no longer generates a "rainbow", it is just solid red.

While it's still early days (this has only recently reached the Beta channel, and won't reach full Release until early March), we have not yet seen any breakage as a result. It's true that there are "demos" such as @yisibl [mentioned](https://github.com/w3c/csswg-drafts/issues/11381#issuecomment-2652590989) which will no longer work, but it should be simple for their authors to change to the correct form of gradient definition: just use `<color> 0 100%` instead of `<color> 0 0`.

I'm pretty skeptical that such "rainbow gradients generated from a single position" are something the web really depends on to a significant degree. I would much prefer to see browsers fix their rendering bugs rather than enshrine this illogical quirk as a special case in the spec.

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


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

Received on Thursday, 13 February 2025 09:50:11 UTC