Less functionality not fully implemented? [#18422]

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

Dr.Sol
Posts: 65
Joined: Thu Mar 20, 2014 2:24 am
Location: Sweden

Less functionality not fully implemented? [#18422]

Post by Dr.Sol »

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
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Less functionality not fully implemented?

Post by drakinite »

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)
Image
Student electrical-computer engineer, 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.
Dr.Sol
Posts: 65
Joined: Thu Mar 20, 2014 2:24 am
Location: Sweden

Re: Less functionality not fully implemented?

Post by Dr.Sol »

Here's an example:

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);
}
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.
MM-Gold user since 2005
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Less functionality not fully implemented?

Post by drakinite »

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
Image
Student electrical-computer engineer, 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.
Post Reply