Last modified: 2011-02-08 21:56:10 UTC
The following in a custom skin worked in older versions of MediaWiki, but in the current trunk it's loaded after the user css function setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); $out->addStyle( 'luontoliitto/main.css', 'screen' ); } <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?debug=true&lang=fi&modules=site&only=styles&skin=luontoliitto&version=20110103T210326Z"> <link rel="stylesheet" href="/w/load.php?debug=true&lang=fi&modules=user&only=styles&skin=luontoliitto&user=Krinkle&version=20110103T210140Z"> <link rel="stylesheet" href="/w/skins/luontoliitto/main.css?301" media="screen">
I _think_ the problem is caused by OutputPage::headElement() doing $ret .= implode( "\n", array( $this->getHeadLinks( $sk ), $this->buildCssLinks(), $this->getHeadItems(), ) ); Here, ResourceLoader is adding its style links in getHeadLinks(), while style links added via addStyle() are output in buildCssLinks(). To fix this issue, either a) the ResourceLoader code could be pulled out of getHeadLinks() into a separate method, b) the call to buildCssLinks() could be moved before getHeadLinks(), or c) the call to buildCssLinks() could be moved _inside_ getHeadLinks(). Not being very familiar with ResourceLoader, I have no idea which of these would be the cleanest solution, or the least likely to cause unexpected side effects.
(In reply to comment #1) > Here, ResourceLoader is adding its style links in getHeadLinks(), while style > links added via addStyle() are output in buildCssLinks(). To fix this issue, > either a) the ResourceLoader code could be pulled out of getHeadLinks() into a > separate method, b) the call to buildCssLinks() could be moved before > getHeadLinks(), or c) the call to buildCssLinks() could be moved _inside_ > getHeadLinks(). Not being very familiar with ResourceLoader, I have no idea > which of these would be the cleanest solution, or the least likely to cause > unexpected side effects. Trevor tried to move the RL stuff into buildCssLinks() but that didn't work too well. I'll poke at this later.
*** Bug 26570 has been marked as a duplicate of this bug. ***
Fixed in r79732.