Less code packaged in WebJars can now be compiled to CSS when requested. When Less files are compiled to CSS, the less variables defined in the current skin are available and will be resolved to their current values.

Usage examples:

// Returns the raw content of test.less
$services.webjars.url('org.xwiki.platform:xwiki-platform-example', 'test.less')
// Returns the content of test.less compiled to css.
$services.webjars.url('org.xwiki.platform:xwiki-platform-example', 'test.less', {'evaluate': true})

Get Connected