dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

Partial sibling combinator matches should be considered superselectors

Open nex3 opened this issue 6 years ago • 1 comments

Currently the following function calls all return false:

  • is-superselector("a ~ c", "a ~ b ~ c")
  • is-superselector("b ~ c", "a ~ b ~ c")
  • is-superselector("a ~ c", "a + b + c")
  • is-superselector("b ~ c", "a + b + c")
  • is-superselector("b + c", "a + b + c")

They should all return true, because a ~ b ~ c and a + b + c both guarantee that c has preceding siblings that match both a and b, and a + b + c guarantees that c has an immediately preceding sibling that matches b.

nex3 avatar Aug 07 '19 23:08 nex3

Similarly, is-superselector("b > c", "a > b > c") should return true.

nex3 avatar Aug 07 '19 23:08 nex3