Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes with the parent selector in their name – can't use them as mixins #2434

Closed
tomek-he-him opened this issue Feb 4, 2015 · 3 comments

Comments

@tomek-he-him
Copy link

Similar to #2216, but it's still there in v2.3.1 .

.a {
  &-b {
    some: stuff;
    }
  }

.c {
  .a-b;
  }

Piped through lessc, this throws a

NameError: .a-b is undefined in ... on line 8, column 3:
7 .c {
8   .a-b;
9   }

Just for the record, without the .c definition everything works as expected:

$ cat <<EOF | lessc -
> .a {
>   &-b {
>     some: stuff;
>     }
>   }
> EOF

.a-b {
  some: stuff;
}
@seven-phases-max
Copy link
Member

This code is not supposed to work currently. Selectors with identifiers concatenated via nesting are not available as mixins. (And no, it's not the same as #2216 - selector "interpolation" there and "concatenation" here are different things).
(The open ticket for this feature-request is #1399 though it contains a lot of not so very related stuff so it not so easy to find anything there. So maybe we need a dedicated one...).

@tomek-he-him
Copy link
Author

@seven-phases-max considering what you said in #2453 this feature wouldn't be necessary, if one could extend .a-b. But that's not possible neither at the moment (see my comment therein).

@seven-phases-max
Copy link
Member

So feel free to close it (well, as I mentioned above such examples are given in #1399 so eventually this might be fixed/implemented as a part of more wide mixin matching improvement regardless of use-cases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants