Available from version 1.25.0 (Gerrit change 187986)
Removed in version 1.31.0
Allows to add context-based Less variables.
Define function:
public static function onResourceLoaderGetLessVars( array &$lessVars ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"ResourceLoaderGetLessVars": "MyExtensionHooks::onResourceLoaderGetLessVars"
Called from:File(s): resourceloader/ResourceLoader.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ResourceLoaderGetLessVars extensions.


  • &$lessVars: An array of already added variables, which can be extended

Removed in v1.31 due to concerns about allowing unmaintainable cross-dependencies. Custom ResourceLoaderModule subclasses can override the getLessVars() method instead.

See alsoEdit