Skip to content

**:not()** with a selector list doesn't expand & symbol #4313

Open
@WORMSS

Description

@WORMSS

:not(&--a):not(&--b) does expand the & symbol into the parent's selector as expected.
:not(&--a, &--b) doesn't expand the & symbol into the parent's selector.

To reproduce:

.works {
  &:not(&--a):not(&--b):hover {
    background-color: green;
  }
}

.broken {
  &:not(&--a, &--b):hover {
    background-color: green;
  }
}

Current behavior:

.works:not(.works--a):not(.works--b):hover {
  background-color: green;
}

.broken:not(&--a, &--b):hover {
  background-color: green;
}

Expected behavior:

.works:not(.works--a):not(.works--b):hover {
  background-color: green;
}

.broken:not(.broken--a, .broken--b):hover {
  background-color: green;
}

Environment information:

  • less version: 4.2.2
  • nodejs version: any
  • operating system: any

We are currently in the middle of a battle of linters. We are told :not(a):not(b) is being classed as complex, and should be changed to :not(a, b)but it appears less forgets to expand when this feature is being used.4.2.2at least compiles the syntax (though incorrectly) our older version4.1.3` just keels over completely.. So I am guessing this is a relatively new feature and hasn't had much usage yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions