Skip to content

Line comments aren't stripped from @supports selector(...) #3527

Open

Description

@thorn0

Is this a bug or is this an expected behavior?

Demo (Less 3.11.3): https://jsbin.com/hewizek/6/edit?html,js,console

Input:

@supports selector(
  :focus-visible // *"a"
) {
  a { 
    color: red;
  }
}

Output:

@supports selector(
    :focus-visible // *"a") {
  a {
    color: red;
  }
}

Expected:

@supports selector(:focus-visible) {
  a {
    color: red;
  }
}

Activity

  1. changed the title [-]Line comments aren't stripped from @support selector(...)[/-] [+]Line comments aren't stripped from @supports selector(...)[/+] on Jul 3, 2020
  2. matthew-dean commented on Jul 13, 2020

    @matthew-dean
    Member

    It's expected behavior, although of course not ideal. The @supports tag and some other at-rules that are not explicitly parsed basically allow anything in the at-rule prelude, and just look for matching blocks (like parentheses).

    This is being re-worked in a smarter parser for Less v5, but there is no timeline currently for that release.

  3. added this to the 4.0 milestone on Jul 13, 2020
  4. modified the milestones: 4.0, 5.0 on Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions