Topic on Project:Support desk

Add global CSS link to head or RessourceLoader?

7
93.184.128.24 (talkcontribs)

Hi, I want to add a site-wide CSS link to teh head element or RessourceLoader (fortawesome.css). Is that possible in LocalSettings?

88.130.76.146 (talkcontribs)

Hi!

You possibly can use LocalSettings.php to overwrite the definitions from vector as you find them in resources/Resources.php. However, I would not say doing so is intended; if you want to change CSS in one of the Core skins, e.g. of Vector, you should better put it on the wiki page MediaWiki:Vector.css in your wiki or - if your changes are bigger - create an own skin.

93.184.128.24 (talkcontribs)

Thanks, I'm surprised there is no easier way. I'm using @import in MediaWiki:Common.css now, but that is a belated HTTP request.

Florianschmidtwelzow (talkcontribs)

(I understand your question so, that you want to add additionally css rules) Sure, you can define a new ResourceLoader module and load your skin in it. After this use the Hook "BeforePagDisplay" and load the module there.

But please notice the hint of "88.130.76.146"

93.184.128.25 (talkcontribs)

Sorry, this sounds way too complicated. MediaWiki got out of hand since the RessourceLoader.

Florianschmidtwelzow (talkcontribs)

That's a matter of opinion ;) It looks complicated, yeah, but there are much more possibilities with RL :)

Johnywhy (talkcontribs)

It should be easy to create isolated global CSS pages, without touching Common.css. One way that would be great would be sub-pages of Common.css. Eg, Common.css/SpecialStyle.css. In fact, when you create a subpage of Common.css, the subpage gets preloaded with /* CSS placed here will be applied to all skins */. But it doesn't seem to work.

Reply to "Add global CSS link to head or RessourceLoader?"