This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
If you define multiple mixins with the same name (differentiated by parameters), WW cannot compile the .less file. I found a related issue that talked about child selectors and name clashes causing the same error, but it seems it is not related to child selectors or the bug is affecting more than one thing. I've attached the non-working less file as well as my workaround (where the overloads have been renamed). Although I am no less expert, I believe the code should be working. You can see similar code on the lesscss.org web page (section "Pattern-matching and Guard expressions", arity matching), which would probably also not compile with WW. |
|
|
The problem is not with defining multiple mixins with the same name; it is when a mixin invokes another mixin with the same name. Notice that in the examples on the lesscss.org site this never happens -- e.g. his This appears to be the same issue as https://github.com/cloudhead/less.js/issues/413 (phrased in terms of classes, but note the comment that "As the compiler sees it, they are the same. Classes in LESS are mixins, and mixins with no parameters are classes."). So this appears to be a known limitation of the Less compiler, and I'm afraid we can't resolve it in Web Workbench; it needs to be addressed within the compiler. |
|
|
I had the idea that every product implemented their own compiler, but it sounds like there is some backend that you rely on for the transformation. Incidentally, that would also explain why the online less compilers also had troubles with my file :) It's a bit sad for a .NET developer to have to forego method overloading, but I suppose I'll live now that I know about the limitation. PS: If the compiler is something that you are using in WW, could you perhaps pass the feature request upwards to the maintainer/developer/vendor in charge of it? |
|