csswg-drafts icon indicating copy to clipboard operation
csswg-drafts copied to clipboard

[css-values-5][css-conditional-5][css-cascade-5] Boolean Multiplier for ValDef syntax

Open fantasai opened this issue 1 year ago • 1 comments

We have a number of places in CSS where we use a boolean syntax for combining queries. It takes the form

<x-query> = not <x-group> | <x-group> [ [ and <x-group> ]* | [ or <x-group> ]* ]
<x-group> = <x> | ( <x-query> ) | <general-enclosed>

Tab and I propose creating a new valdef syntax representing the "boolean expression multiplication" of a given production <x>, so that this can be more easily, obviously, and correctly re-used. Suggested syntax is <boolean [ <x> ]>, with the brackets both serving as a grouping operator and mimicking the range parameters in numerical types e.g. <number [-1, 1]>.

fantasai avatar Oct 25 '24 21:10 fantasai

maybe boolean-expression would be clearer than boolean?

dbaron avatar Oct 26 '24 02:10 dbaron

Closing as duplicate of https://github.com/w3c/csswg-drafts/issues/10457

fantasai avatar Oct 28 '24 21:10 fantasai