[csswg-drafts] [css-values-4] Clarify how slashes are used in grammar (#7218)

SebastianZ has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values-4] Clarify how slashes are used in grammar ==
There are many different syntax definitions using a slash as a separator for values that would otherwise be ambigious. Also, the existing definitions do not allow a leading or trailing slash.

Examples for that are `font`, `border-image`, `border-radius` and `grid-area`.

Though there is currently no clear definition for that.

The slash is obviously some kind of combinator literal. So I suggest to define it as such. That definition would include several things:

1. It separates two ambigious values in the given order.
2. There must always be an item on the left and right side of it, i.e. it can't be placed at the beginning or end of a value syntax. Though adjacent slashes are allowed.
3. The `/` is a literal, meaning it is part of the value.

This allows to simplify the grammar of syntaxes like `border-image`, which could then be defined as

```
<'border-image-source'> || <'border-image-slice'> / <'border-image-width'>? / <'border-image-outset'>? || <'border-image-repeat'>
```

Note, that this change is only meant to allow simplifying the grammar definitions within the specifications and to clarify when slashes are used (over other separators like commas or brackets). It is _not_ meant to touch any existing syntaxes.

Sebastian

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7218 using your GitHub account


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

Received on Thursday, 14 April 2022 23:20:41 UTC