-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
parametric mixin issue #1684
Comments
The compiler interprets colon in your mixin call as arguments separator. If you put semicolon after the argument, then it will treat the colon as a list separator. Fixed example:
You can find more details at less4j wiki or at lesscss.org - search for Mixins With Multiple Parameters. |
Thank you. Isn't there a way to fix this so that "weird" code is not required? |
Well, you could try to invent something better :) See #35. |
:) so, it's only temporary until support for |
No, not really. The |
Because everybody reads the docs? ;-) |
No, just because of zillion less files out there that gets immidiately broken. |
Yes, as a result of not reading the docs.. and old code. |
@seven-phases-max readability is matter of habit :). |
@SomMeri And the habit is a matter of previous experience. Since LESS is not usually the first language one learns it is safe to assume that a fuction/mixin call statement with arguments separated by semicolons is harder to read for him. If I used to read/write some code before, my brain is already tuned to percieve certain character/symbol patterns/sequences as a whole chunks that correspond to specific language statements (and each sequence that does not fit any pattern makes me to stop "scanning" and parse the code on a word-by-word/symbol-by-symbol basis instead). In summary I'd say that "the comma there" is too fundamental habit for many, and they need something really weighty reason to shift. And
is just not enough (even if value lists are significant feature of the language itself). Of course I oversimply things a bit (not counting "designers vs. developers" stuff, "mixins vs. functions" etc.) but in general I think that when the docs (and some libraries like BS) started to push |
@seven-phases-max What do you mean by BS? We can change the "It is recommended to use semicolon" sentence into something like "Although comma is more traditional and look familial to new users, semicolon has its advantages too". Not ideal way to write it, but you can get the idea. |
As designers and programmers, we simply check the docs for syntax examples and we're ready to move forward. We don't mind following the rules as long as they're straightforward. It's like learning PHP, we don't have a problem using If You guys could always go the "v2.0" route for making such drastic changes allowing all the libraries to catch up. |
That quote is about readabilty, or more specifically about "how many efforts you devote to some piece of code to understand what it's about and how fast you can do this". I have no problem using both |
|
@stevenvachon In a way, it is really declaration. You can "declare" arguments in your mixin call. That allows you to skip any arguments you want to skip - it is useful in combination with default values. |
@seven-phases-max There are plans for backward incompatible less 2.0, the most important is this one. I do not remember the rest nor where they are listed. |
@SomMeri Thanks. Yes, I'm aware that Btw., for that matter, I guess that if the support for Either way it seems like we've gone too far in this discussion, and since it was somewhat triggered by my answer to:
Let me to re-answer it: "Yes, maybe" (if you're fine with |
The text was updated successfully, but these errors were encountered: