Apologies if this has been asked in the past but I have not managed to get a working solition.

I have tried to include less vars from my custom module into my theme but I have been unsuccessful. I currently have a var defined in my module.info file as:
less[vars][@FontColor] = '#FF0000'

In the theme admin I see the section for the module -> less -> var displayed but I cannot use @FontColor in my Themes less.css files. I get a variable undefined error.

I have tried using "hook_less_variables" in my template.php file to pull the modules vars and set them as template vars but still no luck.

It seems that my theme does not actually call theme_less_variables.

I have searched/read:
https://www.drupal.org/node/2139603
https://www.drupal.org/node/1543276
https://www.drupal.org/node/1787160

I dont know if I am missing something but nothing has worked for me.

Please advise & Thanks in advanced!

Comments

Ivan_Dagreat created an issue.

Ivan_Dagreat’s picture

Can anyone advise me if this is even possible or an alternative approach?

kurapov’s picture

Check the processing order of variables specified in current theme's .info file, hooks and external modules. I think the variable specified in your module will only apply to the stylesheet declared using less[sheets][] = relative/path/to/stylesheet.css.less in your module's info.

rmajed’s picture

I have faced the same issue, the function of [theme]_less_variables was not being called
so, when i used [theme]_less_variables_alter instead it worked well..
give it a try

rmajed’s picture

I have faced the same issue, the function of [theme]_less_variables was not being called
so, when i used [theme]_less_variables_alter instead it worked well..
give it a try