Manual talk:Interface/Stylesheets

From mediawiki.org

Seems not to work with 1.11.0[edit]

Hello, i recently found this function and i want my wiki to behave the way that depending on the namespace the background is different. I saw this in MediaWiki:Common.css, but when i add this to my Common.css nothing changes.

by the way: any changes made in my Common.css or Common.js does not seem to have an effect. Can anyone help me please? Thanks, --TurboKanne 12:50, 19 February 2008 (UTC)Reply

Broken CSS links[edit]

Common.css and skinname.css (e.g. Vector.css) don’t seem to exist. Common.css was moved to Gadget-site.css without redirect, so I changed that link, but where is the default CSS for the skins located? And do the User: stylesheets still work? —Frungi (talk) 07:58, 25 May 2013 (UTC)Reply

Common.css was moved on mediawiki.org because Extension:Gadgets was installed, so users can disable the load of the now old Common.css on their preferences disabling the "Gadget-site", for testing purposes for example. But this stylesheet is still being loaded --Ciencia Al Poder (talk) 14:35, 9 June 2013 (UTC)Reply

MediaWiki:Skinname.css only works for Vector.css / Solved[edit]

I am using MediaWiki 1.24.1. If I change "MediaWiki/Vector.css" to

/** Hide sidebar **/
div#mw-panel {
  display: none;
}
#left-navigation {
  left: 0em;
}
#mw-head-base,
div#content,
div#footer {
  margin-left: 0em;
}

this works and the left navigation sidebar collapses. It does not work with cologneblue.css or modern.css or my custom skin. Off course I always purge the cache. In Localsettings.php I did declare:

$wgUseSiteCss = true;

Help would be much appreciated--Gogtl (talk) 12:51, 12 December 2015 (UTC).Reply

Other skins may have different IDs for sidebar. Have you checked that the ID is correct on those skins? --Ciencia Al Poder (talk) 16:23, 12 December 2015 (UTC)Reply
Thank you so much Ciencia Al Poder, this is the answer for cologneblue and modern. And your answer led me to the solution for the custom skin. The custom css was named wrongly: MediaWiki:SkinName.css was not read, but MediaWiki:Skinname.css was used. Now everything is working properly! I am so grateful! Kind regards,--Gogtl (talk) 18:31, 12 December 2015 (UTC)Reply

print.css[edit]

Is print.css functioning? I did a quick test on wikipedia, and none of the loaded stylesheets seems to show what should be in wikipedia's print.css. --192.171.49.132 17:07, 5 February 2017 (UTC)Reply

Will subpages of Common.css be applied globally?[edit]

If not, how to globally apply a css-type wiki-page?

Johnywhy (talk) 20:01, 8 June 2018 (UTC)Reply

Add its contents to MediaWiki:Common.css, @import it (as URL) (not recommended) or install it as a gadget. --Ciencia Al Poder (talk) 09:23, 9 June 2018 (UTC)Reply

Why is import not recommended?

It's BAD coding-style to put all CSS into a single file. So if MW requires that, that's a poor design. CSS associated with an extension should get it's own separate CSS page.

When i create a subpage to Common.css, eg Common.css/MyStyle.css, the subpage gets preloaded with

/* CSS placed here will be applied to all skins */

That seems to indicate that the CSS subpage will be applied to all skins. How to make that work? $wgUseSiteCss might be related, but i think that just activates Common.css, and it's enabled by default.


The gadgets page says

The Gadgets extension provides a way FOR USERS TO PICK JavaScript or CSS based "gadgets" that other wiki users provide.

That's different than global css. I don't want users to pick. Is it possible to make global css with Gadgets?

Seems to me, admin should not have to install gadgets or other extensions to create additional global CSS pages. Seems like it should be built-into MW. Johnywhy (talk) 14:10, 9 June 2018 (UTC)Reply

It's not recommended for performance reasons, because imports make a new HTTP request to the server. Gadgets can be enabled by default, and hidden, effectively disallowing users from deactivating them. You can put several CSS and JS files inside the same gadget. Users can create additional CSS pages, as I said, without the need to use extensions. However, the way you should include them is not recommended. Since that's not an essential feature for MediaWiki, core does not provide exactly what you want. --Ciencia Al Poder (talk) 09:33, 10 June 2018 (UTC)Reply

When applying changes to MediaWiki:Common.css no changes are applied to action-edit[edit]

Does action-edit overrides anything? How do I style edit pages?

No it generally does not. But the required specificity of selectors might be different in some cases, so maybe that is interfering for you ? —TheDJ (Not WMF) (talk • contribs) 12:12, 28 May 2020 (UTC)Reply

Common.less and Vector.less ?[edit]

Hi. I've seen that some websites use Common.less and Vector.less : here and here How do they do that ? Wouldn't it be an improvement to be able to use LESS and not just CSS ? --Varlin (talk) 11:30, 22 April 2021 (UTC)Reply

Page is not fully prepared for translations[edit]

From section "CSS selectors" downwards, the translate tags are missing Max123kl (talk) 19:32, 15 April 2024 (UTC)Reply