Skip to content

[css-values] Clarify that || and && are not associative #8017

@Loirooriol

Description

@Loirooriol

https://drafts.csswg.org/css-values-4/#component-combinators already says

For reorderable combinators (||, &&), ordering of the grammar does not matter: components in the same grouping may be interleaved in any order.

But it may be useful to clarify that components in the same grouping can't be interleaved with components of another grouping, e.g.

  • a || b || c allows a, b, c or combinations of them in any order
  • [ a || b ] || c is like a || b || c but it doesn't allow a c b nor b c a
  • a || [ b || c ] is like a || b || c but it doesn't allow b a c nor c a b

Similarly,

  • a && b && c allows the permutations of a, b and c
  • [ a && b ] && c is like a && b && c but it doesn't allow a c b nor b c a
  • a && [ b && c ] is like a && b && c but it doesn't allow b a c nor c a b

In #7884 there is some confusion about this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions