Re: [csswg-drafts] [css-images-4] Fix basic syntax of gradients (#8367)

Right, and actually I would have preferred the other syntax for two reasons.

First, the trailing `?` in `[[[<rg-ending-shape> || <rg-size>]? [at <position>]?] || <color-interpolation-method>]?` is useless, which does not seem right to me.

Second, the result is not consistent with the result from parsing other gradients.

`conic-gradient(red, cyan)`, `linear-gradient(red, cyan)`, `radial-gradient(red, cyan)`, produce the following pseudo-representations:

```
ConicGradient(
  Omitted('[[[from <angle>]? [at <position>]?] || <color-interpolation-method>]')`,
  ColorStopList(Keyword('red'), Keyword('cyan')),
)
LinearGradient(
  Omitted('[[<angle> | to <side-or-corner>] || <color-interpolation-method>]')`,
  ColorStopList(Keyword('red'), Keyword('cyan')),
)
RadialGradient(
  List(
    List(Omitted('<rg-ending-shape> || <rg-size>'), Omitted('at <position>')), 
    Omitted('<color-interpolation-method>')
  ),
  ColorStopList(Keyword('red'), Keyword('cyan')),
)
```

---

I let you see if the following asides/ideas are worth creating a new issue:

**Aside 1:**

`<rg-ending-shape>` could be replaced by `<basic-shape>` to allow new shapes of radial gradients.

`circle` or `ellipse` (possibly qualified with `<extent-keyword>`) would be aliases of `circle(100% at center center)` and `ellipse(100% 100% at center center)`.

**Aside 2:**

`<rg-size>` is `<rg-extent-kewyord>` + `<length-percentage>` for `radial-gradient()`, and is `<rg-extent-kewyord>` + `sides` for [`<ray()>`](https://drafts.fxtf.org/motion-1/#funcdef-offset-path-ray).

I think the related productions would be better defined without `<size>`, whose semantic seems too broad to me:

```
<radial-gradient()> = radial-gradient( [ ... || [ <extent-keyword> | <length> | <length-percentage> ] ] ... )
<ray()> = ray( [ ... && [ <extent-keyword> | sides ] && ... ] )

<extent-keyword> = closest-corner | closest-side | farthest-corner | farthest-side
```

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/8367#issuecomment-1408147460 using your GitHub account


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

Received on Monday, 30 January 2023 08:04:00 UTC