(There was no bug yet for "addModuleStyles should support dependencies" - which I've commonly said is WONTFIX, so I'll put it here so I can refer to it)
Just semantics, but there is no case of ResourceLoader not being able to handle skin css dependencies. It is impossible by design due to restrictions outside ResourceLoader.
Some of these restrictions are:
- Skin css can't require javascript, which means we can't just list the top level modules and handle dependencies client-side, we'd have to flatten and hardcode dependencies in the page html <link> tag
- page html must not be required to change for things not to break, cached page html must continue to work. This means:
2a) version can't be in page html, 2b) This can't work because if a dependency is added or things moved into a lower-level module, then all existing page cache will be broken as it would now have a <link> that soon generates an incomplete stylesheet where a dependency is missing.
Possible solutions involve ESI, which is fine for enhancement (we can make the <link> tag contain a version number that way for better caching), but we don't want to depend on it for proper functionality, which means we can't have it replace dependencies.
Alternatively (current practice[1]) you can continue the convention that one *should not* use addModuleStyles for anything other than the core basic css (which must not have dependencies or concerns about module order).
If you want dependencies, you'll have to join the regular load stack, which won't run without javascript.
See:
- bug 45229
- Ia5eadcfcd4b98685
- ...
[1] https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader#CSS_2
Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=29693
https://bugzilla.wikimedia.org/show_bug.cgi?id=45229