Hello,
the LESS API can't let us doing such things. So sorry, we can't plug directly.
However, there are many hooks and filter you can deal with to achieve your goal. I realized it's a bit complicated to do that so I added a wp-less_compiler_parse, plus 2 new methods on the compiler, getBuffer and setBuffer.
This way, you can alter to loaded LESS file before it is pared and outputed in a pure CSS file:
@siteurl: %%bloginfo_url%%;
@cdn_doman: %%cdn_domain%%;
@bgcolor: %%yourtheme_bgcolor%%;
body{
background: @bgcolor url('@cdn_domain/specialdir/background.png');
}
And in a PHP function file, or whatever name it has:
add_action('wp-less_compiler_parse', 'my_plugin_less_replace_vars');
function my_plugin_less_replace_vars(WPLessCompiler $compiler){
$compiler->setBuffer(str_replace(
array(
'%%bloginfo_url%%'
'%%cdn_domain%%',
'%%yourtheme_bgcolor%%',
),
array(
get_bloginfo('url'),
aClass::aSpecialMethod(),
get_theme_background_color(),
),
$compiler->getBuffer()
));
}