less.ruby
less.ruby copied to clipboard
Dynamic Mixins Not Nesting Properly
.foo(@bar:1){
div{color:red;}}
#test{.foo(2);}
Produces (note the rogue 'foo' that has been added to the nested property!):
#test {
foo div { color: red; }
}
This is on v1.2.11 btw
It looks like the mixin name is always getting added for nested children. Here's some test markup:
.box-shadow-mixin (@h: 0, @v: 0, @blur: 0, @color: none) {
box-shadow: @h @v @blur @color;
-moz-box-shadow: @h @v @blur @color;
-webkit-box-shadow: @h @v @blur @color;
h1 {
background-color: @color;
}
}
.random-box {
.box-shadow-mixin(0, 2px, 10px, black);
}
I had to reimplement dynamic mixins in a more robust way, to isolate them from external scope (circa 1.2.11), the problem with that is nesting won't work, so for now it'll throw a compile error, until I figure out a good way to implement this (and have the time to do so), which plays nicely with nesting.
Good to know. I noticed recent activity and it's nice to see that this is part of what's being worked on! Thanks, dude.