Page MenuHomePhabricator

Avoid ResourceLoaderGetLessVars hook in MinervaNeue
Closed, ResolvedPublic

Description

Minerva currently uses this hook to expose the $wgMinervaApplyKnownTemplateHacks config variable to the skins.minerva.tablet.styles and skins.minerva.content.styles stylesheet modules.

This should instead use the getLessVars module method instead of the global ResourceLoaderGetLessVars hook.

Looking closer at the specific use case here, it seems to mainly be used as a boolean flag to include an additional less file. It might be more convenient to do this at the module definition level instead. E.g. the module can be defined a number of different files in the styles array and then one of them is only added based on the config var. (E.g. instead of using 1 less file as entry point that imports 5 others, specify the 4-5 files directly).

I can see why you might prefer to keep the logic in Less, so the getLessVars module method works too.

Related: T66578

Event Timeline

Krinkle created this task.Jul 22 2017, 1:21 AM

It's worth pointing out that $wgMinervaApplyKnownTemplateHacks will be removed as soon as TemplateStyles is enabled everywhere and we have a migration path to migrate these styles to the wikis.

Jdlrobson updated the task description. (Show Details)Jul 24 2017, 8:50 PM
Jdlrobson moved this task from Backlog to Desktop on the MinervaNeue board.Aug 16 2017, 8:47 PM
Jdlrobson edited projects, added MinervaNeue (Desktop); removed MinervaNeue.

Change 423581 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/skins/MinervaNeue@master] Convert custom LESS var from global to local

https://gerrit.wikimedia.org/r/423581

Krinkle assigned this task to Jdlrobson.Apr 2 2018, 11:20 PM

Change 423581 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Convert custom LESS var from global to local

https://gerrit.wikimedia.org/r/423581