-
Notifications
You must be signed in to change notification settings - Fork 2
Make less.js version compatibility more explicit #340
Comments
Hi, Can you test if the official Lessc 2.0 converts This methods to convert color names to hexa may be useful, so I will probably add an option to either keep color name or convert to hexa. EDIT: it seems some values are ignored, like |
@Asenar Yes, LESS version 1 and 2 treat color words differently.
The issue I was facing is that I want to use red purely as a word, not as a color value. For example, I was trying to turn a color list into some swatch classes. To be honest, this is a tiny programming irritation to overcome. |
The color-words issue is very minor to me, it is an irritating blemish on otherwise nice language. I'm pretty comfortable using LESS v1.7.0. But it made me wonder: are there any LESS language features added in v2? I don't know. I'm pretty new to LESS, so I'm still trying to learn. From what I can tell looking at the less.js changelog is that a lot of the version changes are around the parser, not the language. But I haven't looked very closely, and frankly this is why I opened this issue: it takes a lot of time and energy to investigate this stuff. Mainly I'm trying to surface knowledge and pushing for better docs. Not asking for any radical interventions. I think this is double important if LESS v3 introduces breaking changes, or adds new behavior. At present it's not clear from oyejorge/less.php README.md that this library is pinned at LESS v1.7 even though LESS v2 has been out for years. I'm familiar with SASS and the nice thing about SASS is they do a good job of documenting the language features and the community keeps track of all of the different SASS parsers: sass-compatibility.github.io |
@mfdj: if you need less 2 features use can use iless... https://packagist.org/packages/mishal/iless |
Suggestion
I'm opening this issue to help newcomers understand how less.php versioning works. I don't expect high-parity with less.js and I appreciate that maintaining an open source library (especially a cross-language port) is a tough job. Thanks for your hard work!
Currently it's not super obvious that less.php is compatible with less.js 1.7.0. Also, since less.js v3 is in the works I think it's important to clearly document which language features are supported so that users of this library (especially newcomers to the LESS language) have a clear idea of which features they can reliably use.
Rationale: Unexpected LESS v1 behavior
I was recently caught off guard when I tried to use the word
red
in a list. The basic problem can be summarized by the following LESS snippet:In LESS 1.x it parses to:
In LESS 2.x it parses to:
I was trying to use white and red in a list of classes to generate codepen.io/mfdj/pen/PWMLVW. Since I'm new to using LESS it took me awhile to figure out this was a breaking change between LESS v1 and v2 and that less.php supported v1 syntax.
Related
The following issues helped me understand the state of things so I'm linking them here as others may find them interesting:
1.7.0.10
to indicate that it's tracking LESS.js1.7.0
the last number indicated the10
internal revision of this libraryAlso there are some forks in the wild, so I think it would be timely to make the scope of this project more clear:
The text was updated successfully, but these errors were encountered: