Send a variable too less file
Permalink
Hi,
Sorry if this is a newbie question. Is it possible to send a parameter to my theme less file (from php)? i mean something like font-size to less?
Sorry if this is a newbie question. Is it possible to send a parameter to my theme less file (from php)? i mean something like font-size to less?
So you want to define your font size in php?
Yes.
You could make your css file a php file. I assume you could make your less file a php file, too. In which case php would be available.
Hi Sepehr,
I think you might be able to using the Less_Parser class.
https://github.com/oyejorge/less.php...
A couple core examples of using the Less_Parser are: the StyleCustomizer class and the Feature block.
Here is an example of the Less_Parser's ModifyVars() method being used to modify Less variables and then turning the Less file into a required CSS asset:
https://github.com/mlocati/concrete5-cover-picture-7/blob/master/blo...
I think you might be able to using the Less_Parser class.
https://github.com/oyejorge/less.php...
A couple core examples of using the Less_Parser are: the StyleCustomizer class and the Feature block.
Here is an example of the Less_Parser's ModifyVars() method being used to modify Less variables and then turning the Less file into a required CSS asset:
https://github.com/mlocati/concrete5-cover-picture-7/blob/master/blo...