leafo/lessphp — Issue #203: Recursive mixins
Author: Barryvdh
Created: 2012-03-06 09:38:56+00:00
State: open

When looking at Twitter Bootstrap, they are under the assumption that recursive mixins will be supported in the upcoming release of LESS.

https://github.com/twitter/bootstrap/issues/1791#issuecomment-4339986
"Just to update you guys on this - i've been working with @cloudhead on this, and we've got an awesome solution here: https://github.com/twitter/bootstrap/blob/new_grid/less/mixins.less#L483

But we can't merge until he releases the next version of Less (which should be really soon :)"

Wich looks something like:

.spanX (@index) when (@index > 0) {
~".span@{index}" { .span(@index); }
#grid .spanX(@index - 1);
}
.spanX (@index, child) when (@index > 0) {
~"> .span@{index}" { .span(@index); }
#grid .spanX(@index - 1, child);
}
.spanX (0, ...) {}

// generate .spanX and .offsetX
#grid .spanX (@gridColumns);
#grid .offsetX (@gridColumns);

Will this also be supported in lessphp? Otherwise, the new release of Bootstrap will not be usable with lessphp..