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

Output of interpolated selector with nested rules is different than written out #3098

Closed
chazsolo opened this issue Sep 6, 2017 · 2 comments

Comments

@chazsolo
Copy link

chazsolo commented Sep 6, 2017

I noticed this while playing around with selector interpolation on less2css.org (v2.5.3):

If I use an interpolated selector with nested rules, the output is not what I expected (when compared to written out). For example, the given input:

@classes: ~".a, .b, .c";

@{classes} {  
  + .z {
    color: blue; 
  }
}

.p, .q, .r {
  + .z {
    color: blue;
  }
}

provides the following output:

.a, .b, .c + .z {
  color: blue;
}
.p + .z,
.q + .z,
.r + .z {
  color: blue;
}

Shouldn't the interpolated class output include + .z for each selector instead of just the final one, .c?

@seven-phases-max
Copy link
Member

No. In short ~".a, .b, .c" is not a list of selectors. See #1421 and other issues referenced there for more details.

@seven-phases-max
Copy link
Member

Closing as duplicate of #1546 (but the mother issue is #1421, there's also an issue somewhere with more details on possible implementations and syntax for the desired feature but I can't find it right now: todo).

matthew-dean added a commit to matthew-dean/less.js that referenced this issue Jun 3, 2018
matthew-dean added a commit that referenced this issue Jun 16, 2018
…3217)

* Adds passing test from #3098
* Added passing test example from #1817
* Allow lists to be re-evaluated as selectors (Fixes #1694)
matthew-dean added a commit that referenced this issue Jun 25, 2018
…no.2) (#3227)

* Fix element to selector list conversion, passing all tests!
* Add passing test from #3098
* Added passing test example from #1817
* Allow lists to be re-evaluated as selectors (Fixes #1694)
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