-
Notifications
You must be signed in to change notification settings - Fork 528
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
Syntax differences #16
Comments
It was initially. I haven't been paying attention to the development of the original lately, so I am sure there are differences that I haven't been able to keep track of. |
I've checked it - official Less is far behind this. :) |
One thing that constantly trips me up is the difference between calling mixins with arguments. Official LESS uses |
it should not be a big problem to find it and change it in the source code ;) |
Ok ok I'm forking it now. I've got a few patches to add anyway. I'll send a pull request to leafo in a minute. |
yeah I also have some patches for leafo to add, but I've done it with Less 1.6 so I'll probably wait until final 2.0 is out |
Wait, this thing is actually versioned? =) |
xdissent, there is a reason why I use If you recall, a single css property's value can be a comma separated list of things. If you use eg.
I did the argument passing before official less, so I just decided on |
Oh oh I see. Wow, good catch. After following the official LESS package since conception, it's become apparent that cloudhead's development cycle is a pretty… frantic? It's always bursts of rapid changes, with more attention to advancements than fixes or issues. And now it looks like he's completely abandoned the Ruby LESS compiler in favor of a very marginally working Javascript implementation. Par for course I guess. In light of the rationale behind it, I like the semicolon. It would be killer to update the docs to note the difference though. |
The docs implicitly demonstrate it, but I will definitely make it more apparent. |
leafo, Firstly thank you for writing this port for the PHP community! You have a point regarding ";" vs "," for argument separation. However I think its more important to have a standard common compatible LESS syntax between implementations. Otherwise users cannot share LESS CSS code between their e.g. PHP (lessphp) and Node.js/JavaScript (less.js) projects. Even more damaging is that it makes it impossible for anyone to provide a common framework, such as SASS has with the compass framework. Is there any room for improving this situation with an aim of LESS CSS portability between implementations? Or are you sold on using ";" regardless ? Personally I have no preference for either character but I do feel that "," is the more commonly accepted / "official" syntax. As a person trying to contribute to the LESS CSS framework space, and as a user of both Drupal/Lessphp + Node.js/Less.js my options basically are:
I think the first option, having a common syntax, would be of the most benefit to users of LESS overall. Other options are basically stopgap measures if that fails. xdissent, Less.js was in early development when you made your comment. Recent versions work very well and I've been using it for several large projects. |
You are the first person to contact me about changing it. I don't know how entrenched the I prefer the |
Thanks for your thoughtful response. I think an optional compatibility flag to enable Beyond that If it was a fresh spec with no differing implementations and code out in the wild I think I agree you can't just break backwards compatibility for your users by changing it outright for the sake of code portability to less.js. Compatibility flags will at least significantly improve the situation by allowing users choice in LESS parsers and frameworks. Hopefully the situation will improve even more in the future. Cheers. |
Are there any other syntax or evaluation differences? There should be a section with any differences at the top of the docs. Compatibility flags sounds like the best you can do if you fix things that cloudhead is not planning to. +1 As for ; vs , I think this can be solved more elegantly if you just add the ability to escape commas in arguments, or a way to delimit each argument with something like quotes or brackets. That would make Ruby-Less code compatible with lessphp, although not the other way around. Hopefully, they will see the light and follow your example. |
Please make it compatible with Ruby-Less (the defacto standard) You could always split parameters by ,@ (a comma the an at symbol), or provide escaping , |
In my opinion since http://lesscss.org/ has moved to Less.js instead of Ruby the JavaScript-Less is the "de-facto standard", if there is any standard. Regardless the parameter syntax is the same. Just think its worth mentioning that if there are any differences between the Ruby and JavaScript versions the JavaScript version should be taken as more authoritative. |
+1 For compatibility mode, this would be pretty useful. |
I am going over lessjs right now to find any differences, please tell me if I am leaving anything out. I see an I noticed that I added all the color functions that lessjs has, I also replicated the behavior of hsl and hsla functions. And then there is the matter of the argument delimiter. I am going to add support for I am also going to update my documentation, and use the same naming conventions as lessjs. |
Less.js introduced the %() function, which is equivalent to your quote() function. I think you should make an alias for compatibility. I have also detected a critical bug : |
Re parametric mixins: Great, having those mixin functions output to the CSS has always bothered me. |
About the compatitibility mode, has it been implemented yet ? |
In regard to the |
Check the 3.0 branch, https://github.com/leafo/lessphp/tree/0.3.0 |
Thanks for your effort! I'm gonna check out 0.3.0. I was going through all my less files, changing all , to ; , but it was taking to much time and things got a little unclear in some mixins. Glad you're trying to make it compatible. |
parses fine! Great, thanks for this! Now I can use less.app, less.js en lessphp together. |
Amazing work, much appreciate the new compatibility with official less. One issue I am having is that the following line from twitter-bootstrap is throwing a parse error (didn't you mention you had created an alias for |
Is being compatible with the official LESS parser a goal?
The text was updated successfully, but these errors were encountered: