Since the introduction of the LESS compiler into ResourceLoader some skins and extensions make use of variables. In most cases those variables are placed in a dedicated file (e.g. variables.less
).
As $wgResourceLoaderLESSVars
[2][3] is deprecated the only obvious ways to alter the variable values are either by binding to the hook ResourceLoaderGetLessVars
[4] or (within a custom RL module) by implementing ResourceLoaderModule::getLessVars
. The later one can not be used to actually modify anything outside of that particular module.
So my questions are:
- Is there a good way to override variables defined by a
variables.less
file? E.g. if I wanted to derive a new skin from vector but want to change some of the variables. - Is there a recommended way to define variables (e.g. in custom skins and extensions) so that they can easily be changed by other skins/extensions or configuration?
[1] https://github.com/wikimedia/mediawiki-skins-Vector/blob/master/variables.less
[2] https://www.mediawiki.org/wiki/Manual:$wgResourceLoaderLESSVars
[3] https://phabricator.wikimedia.org/T140804
[4] https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetLessVars