Since anyone can edit TemplateStyles subpages (in contrast to normal CSS pages like this one, which are constrained to interface admins), there are strict restrictions on what they can contain. @import
is not disabled, just restricted: it can import only URLs that match one of the regexes in the $wgTemplateStylesAllowedUrls['css']
array—which is the empty array by default (and, as far as I see, in Wikimedia production as well). So no hack is needed, @import
is supported, just disabled. (And since it’s intentionally disabled, we shouldn’t try to work this restriction around. The clean way would be a configuration change request, where the system administrators have the option to do it or deny it. However, as Izno wrote, @import
ing the CSS doesn’t solve the maintenance issue; in contrast, it just makes it more likely that a change applied to both the wikicode and the CSS here on mediawiki.org will break other wikis, which load the new CSS from mediawiki.org and apply it to the old, locally generated wikicode. Using TemplateStyles and copying the CSS around as well makes sure that the two stay in sync.)