Re: [csswg-drafts] [css-images-4][css-backgrounds-4] Added stripes() function (#7029)

> > > ```
> > > * Is it ok to allow different orders in the syntaxes?
> > > ```
> > 
> > 
> > I used the [double pipe](https://drafts.csswg.org/css-values-4/#comb-any) in the syntaxes, i.e. `<color> || <1d-image>`. This allows the two values to be in any order.
> > That allows to specify something like `border-color: red stripes(white, silver) stripes(white, silver) yellow lime stripes(black, gray) blue;`.
> > We might use juxtaposing instead, i.e. `<color> <1d-image>` to force the order of first `<color>` then `<1d-image>`.
> 
> Oh no, you need to use a single pipe: `[ <<color>> | <<1d-image>> ]`. It's a `<color>` OR `<1d-image>` but not both. It doesn't make sense to have `border-color: red stripes(white, silver) stripes(white, silver) yellow lime stripes(black, gray) blue;` because you can't tell what is for what side.

I deliberately chose to allow both, so `<color>` serves as a fallback, as you noticed in an inline comment. `border-color` is one place where slashes would make it easier to distinguish between the different values like we have it for `grid-area`. So we could also express the syntax as:

```
<<color>>{1,4} | <<color>> <<1d-image>>? [ / <<color>> <<1d-image>>? ]{0,3}
```

That means, authors have to add the slashes when using `<1d-image>`, while the existing `<color>`-only syntax without slashes is still supported as legacy syntax. Applied to my example above, this would then look like

```
border-color: red stripes(white, silver) / yellow stripes(white, silver) / lime stripes(black, gray) / blue;
```

Sebastian

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


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

Received on Thursday, 21 April 2022 09:43:39 UTC