- From: Lea Verou via GitHub <sysbot+gh@w3.org>
- Date: Thu, 21 Apr 2022 15:12:42 +0000
- To: public-css-archive@w3.org
> > > > ```
> > > > * 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
What kind of fallback? If `stripes()` is not supported, the entire declaration would be dropped, including the color.
If we want `stripes()` to accept an optional color to paint the stripes over, it should probably be part of the syntax for `stripes()`, not in each individual property's grammar as separate tokens. @fantasai any thoughts on this?
--
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/7029#issuecomment-1105359025 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 15:12:44 UTC