Skip to content

variable values cannot be selectors without escaping #1328

@maniqui

Description

@maniqui

Example code (taken from less2css.org):

// Selector interpolation only works in 1.3.1+. Try it!
@theGoodThings: ~".food, .beer, .sleep, .javascript";

@{theGoodThings} {
  font-weight: bolder;
}

The value assigned to variable will also work if written this way (not escaped):

@theGoodThings: .food, .beer, .sleep, .javascript;

But will fail with a ParseError: Unrecognised input if any term has an hyphen (-) on it, like this:

@theGoodThings: .tasty-food;

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