question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

selector() bugs in block mixins

See original GitHub issue

If you nest block mixins the selectors get created correctly but the selector() bif fails to return the full path.

aBlockMixin(name){
    outerSel = selector();
    .{name} {
        {block}
        sel: selector()
        outerSel: outerSel
    }
}


+aBlockMixin(joe){
    color: blue;

    +aBlockMixin(bob){
        color: green;
    }
}

yields:

.joe {
  color: #00f;
  sel: '.joe';  //correct
  outerSel: '&';  //correct 
}
.joe .bob {
  color: #008000;
  sel: '.bob';  //should be ".joe .bob"
  outerSel: '&';  //should be ".joe"
}

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
ghostcommented, Jan 14, 2016

Any updates?

0reactions
ghostcommented, Oct 15, 2015

Highly interested seeing this fixed as it disallows me from porting chili to Stylus, which was originally the intended compiler for the project. https://github.com/salsita/chili

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to perform some operations on the & selector inside a ...
I'm trying to perform some string operations on the current selector & while inside a LESS mixin, but no matter what I try,...
Read more >
Extends in less - Scott Logic Blog
With extends I can say that one class wants to have the properties of another by the inclusion of the selector in the...
Read more >
Extending In Sass Without Creating A Mess
The @extend directive in Sass is a powerful directive that facilitates the sharing of rules and relationships between selectors.
Read more >
Changelog | Stylelint
Added: ignore: ["inside-block"] and splitList to selector-disallowed-list ... Fixed: selector-class-pattern false positives for Less parametric mixins ...
Read more >
Lists - Sass
The @each rule evaluates a block of styles for each element in a list, ... If the value isn't in the list at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found