Less functionality not fully implemented? [#18422]
Moderators: jiri, drakinite, Addon Administrators
Less functionality not fully implemented? [#18422]
Is not all .less language fully implented? It seems like the .less compiler which is used for the skinning doesn’t understand some functions. According to less.org it should be fine using mod, floor and other mathematical functions mentioned on their web site, but when I try using them the monkey refuses to start correctly.
MM-Gold user since 2005
Re: Less functionality not fully implemented?
Could you provide an example of what you're attempting to do?
If you're attempting to use a native CSS calc() function, you'll have to use an escaped value with the tilde (~) character (for an example, check skin_checkbox.less and skin_layout.less)
If you're attempting to use a native CSS calc() function, you'll have to use an escaped value with the tilde (~) character (for an example, check skin_checkbox.less and skin_layout.less)

Data scientist, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
Re: Less functionality not fully implemented?
Here's an example:
There are several .less functions presented on https://lesscss.org/functions/#math-functions and the they are accepted when writing them on lesscss.orgs test page https://lesscss.org/less-preview/, but they seems not working very well in a .less-file for a MM5-skin. I have also seen some other other lack of functions, but that I could solve with writing it in another way. Of course it can be workarounds with this also, but I was only interested hearing if there are any restrictions of not using some functionality in the .less language.
Code: Select all
@a: 25;
@b: 8;
@normaluse: 2;
.f2() {
background: blue;
}
.f1(@_func) when (mod(floor(@_func/@normaluse),2)=1) { .f2(); }
p {
.f1(@_func:6);
}
MM-Gold user since 2005
Re: Less functionality not fully implemented?
I see. After looking, it appears that we're using a really old version of less.js - specifically version 1.3.3, which was released in 2013. I'll talk to Petr about updating it. Tracked as: https://www.ventismedia.com/mantis/view.php?id=18422

Data scientist, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.