MediaWiki talk:Common.css/Archive 1

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Refs formatting

can someone please add the following definitions from en-wiki to support refs formatting?

/* make the list of references look smaller */
ol.references {
   font-size: 100%;
}

.references-small { font-size: 90%;}

/* VALIDATOR NOTICE: the following is correct, but the W3C validator doesn't accept it */
/* -moz-* is a vendor-specific extension (CSS 2.1 4.1.2.1) */
/* column-count is from the CSS3 module "CSS Multi-column Layout" */
/* Please ignore any validator errors caused by these two lines */
.references-2column {
  font-size: 90%;
  -moz-column-count:2;
  column-count:2;
}

.same-bg { background: none }

/* Highlight clicked reference in blue to help navigation */

ol.references > li:target {
 background-color: #DEF;
}

sup.reference:target { 
  background-color: #DEF;
}

Thanks!lensovet 00:23, 6 May 2007 (UTC)

....We don't really use refs? --pfctdayelise (说什么?) 14:55, 10 May 2007 (UTC)
Really? See what links here ;) lensovet 17:24, 10 May 2007 (UTC)
What would be the advantage of such a change? Since this will be used in every page loaded, I'm not sure it's a good idea to add it even though the use of refs is rare on commons. Yonatan talk 21:29, 12 May 2007 (UTC)

(Editprotected template removed - I suppose it's a "No"...) Michelet-密是力 04:55, 19 June 2007 (UTC)

This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

UTC boxes

{{editprotected}} The styles for UTC boxes are not used anymore, since the templates has been changed. Those styles should be removed from here to reduce the size of the css file. /90.229.135.239 10:36, 8 August 2007 (UTC)

Done. -- Bryan (talk to me) 17:55, 23 September 2007 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

Update for right-to-left languages

{{Editprotected}} Please add this section to the css code, to let the ULs and OLs in right-to-left languages show correctly:

div.RTL * ul {
margin-right:10px;
display:table;
}

div.RTL * ol {
margin-right:10px;
display:table;
}

It allows wrapping all the text on a right-to-left page (like الصفحة الرئيسية) in a <div class="rtl">...</div> to make sure the ULs and OLs look fine (don't get out of their container boxes, etc). This code has been in use for more than a year in Persian Wikipedia.

Thanks in advance, HujiStat 12:01, 28 December 2007 (UTC)

✓ Done, thankyou pfctdayelise (说什么?) 13:11, 2 January 2008 (UTC)
Thank you HujiStat 16:23, 2 January 2008 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

Redlink supression

{{Editprotected}} The following CSS was added to en:WP based on CSS already in use at meta:

/* suppress missing interwiki image links where #ifexist cannot be used due to high number of requests */
/* use restricted to rail icon management pages */
/* see .hidden-redlink on http://meta.wikimedia.org/wiki/MediaWiki:Common.css */
.check-icon a.new {
    display: none; 
    speak:none;
}

in order that the table (here at User:AlisonW/Rail_Icons) would work, suppressing the icons not existing currently. Although the page is maintained in userspace (due to using CSS to supress the links) it has been very well received and making it available directly here on Commons would benefit both other projects seeking a needed pictogram but also reduce the likelihood of duplicate icons being created under different codes (which seems to have happened frequently). --AlisonW 13:24, 11 January 2008 (UTC)

So you want the above code added to Common.css? According to the comments at the top of the page, these changes must be proposed at Commons:Village Pump, and as I know very little CSS etc. I think it'd be a good idea if you did that. Giggy 07:01, 12 January 2008 (UTC)
{✓ Done with the original name (ie. as hidden-redlink instead of check-icon). Platonides 16:45, 8 February 2008 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

background marker for update-since-last-visit edits in history

Yesterday Bapti added:

/* To color the mention "updated since my last visit" in the history */
span.updatedmarker {
	color: black;
	background-color: #0f0;
}

I undid that edit because I have not found a consensus for such blinking marks on the history page. If I am mistaken please revert my undo. But untill then I think this is something for the user-custom css and not Commons.css (which sets it globally for all users on all skins). –Krinkletalk 11:09, 8 April 2010 (UTC)

It has looked like that in the default skin for a long time. I see no reason to remove it for all users just because default skin is changed to vector. /Ö 12:22, 8 April 2010 (UTC)
Exactly. Just have a look on main.css in monobook skin and the same in vector skin : the updatemarker is defined in the first case, not in the other.--Bapti 15:08, 8 April 2010 (UTC)
The color is a bit surprising, but I was somewhat used to that too. Besides, w/o any color, there isn't sufficient contrast to distinguish "updated since my last visit" from the remaining text of the edit summary. -- User:Docu at 15:22, 8 April 2010 (UTC)
Alrighty, I didn't knew it was in the core default of Monobook. I did look for it in MediaWiki:monobook.css but didn't find it. Thanks for the reponses, now it's written down for later reference. I've reverted my edit. –Krinkletalk 00:51, 9 April 2010 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

Hide TOC on File pages

Instead of using __NOTOC__ on every single File page, how about using a script instead ? Perhaps if technically possible let it be done in the MediaWiki software if and when settings can be set per namespace for this behaviour. Untill then I think the following snippet would be handy :

/* Hide TOC on File pages */
addOnloadHook(function(){ 
if(wgCanonicalNamespace == "File"){
  a = document.getElementById("toc");
  if(a){ a.style.display = "none !important"; }
}
});

What do you think ? –Krinkletalk 16:46, 21 July 2010 (UTC)

 Support Talked with him on IRC, personally I never saw an image where a TOC would be neccessary & this would also allow us to stop putting __NOTOC__ on very second page--DieBuche (talk) 16:49, 21 July 2010 (UTC)
You don't need JS for this. Use the following CSS code: .ns-6 #toc { display: none !important; } -- Bryan (talk to me) 17:02, 21 July 2010 (UTC)
I considered CSS, but went with JS because I couldn't get the specific namespace. Forgot about body.ns-. So yeah, that CSS would be perfect. –Krinkletalk 17:08, 21 July 2010 (UTC)
An alternate solution could be to add __NOTOC__ into some of the templates that include headers, e.g. Template:Check categories  Docu  at 03:40, 16 August 2010 (UTC)
This has already been implenented in August 2010 with a CSS one-liner. Works perfect. –Krinkletalk 23:00, 18 December 2010 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

Checkered background for file history

{{Edit request}}

Can we change the following line:

#file img, .gallerybox .thumb img { background: url(...) repeat; }

to:

#file img, .filehistory a img, .gallerybox .thumb img { background: url(...) repeat; }

This will cause transparent images in the file hsitory table to be shown with the checkered background. See File:Circle frame.svg and en:File:Circle frame.svg for comparison. EdokterTalk 13:41, 16 December 2010 (UTC)

✓ DoneKrinkletalk 22:58, 18 December 2010 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

Arrow for job queue

{{Editprotected}} The CSS for removing the arrow on the job queue link at Special:Statistics is no longer needed, as the job queue is no longer included in that page as of 1.17. – Adrignola talk 13:25, 19 March 2011 (UTC)

✓ DoneKwj2772 (msg) 08:27, 20 March 2011 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

Fix CSS on secure server

{{Editprotected}}

Hello!

Could someone replace the line

@import url("/w/index.php?title=MediaWiki:Common.css/Mboxes.css&action=raw&ctype=text/css") screen;

by the content of MediaWiki:Common.css/Mboxes.css, so that the CSS also works on secure server? Currently it is causing the following error (bug #30294):

GET https://secure.wikimedia.org/w/index.php?title=MediaWiki:Common.css/Mboxes.css&action=raw&ctype=text/css 404 (Not Found)

Helder 12:02, 13 August 2011 (UTC)

✓ Done. I'll bend over backwards because the developers can't fix what they break. It worked before. – Adrignola talk 19:10, 26 August 2011 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

CSS for babel box generated by extension is needed

There are big difference in appearance of babel box between local templates and systematically-generated box.[2] Styles of box generated by extension should be sync'ed with those of local template by configuring Common.css. Thank you. – Kwj2772 (msg) 15:03, 13 October 2011 (UTC)

Please add this code to synchronize style of symtematically-generated babel box with that of local templates. Thanks. – Kwj2772 (msg) 14:07, 22 October 2011 (UTC)
✓ Done--DieBuche (talk) 14:20, 23 October 2011 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

Persian

{{Editrequest}} Hi, please add this:

/* Persian specific customization */
html[lang=fa] body {
  font-family: Tahoma, 'DejaVu Sans', sans-serif;
  font-size: 110%;
}

This will make commons like our home wiki! −ebraminiotalk 11:33, 4 January 2013 (UTC)

I've also invited Persian Wikipedia users to confirm this modification! :) −ebraminiotalk 20:48, 4 January 2013 (UTC)

Thanks for the fast response. However, please remove the font-size line; it breaks the interface layout. Huji (talk) 22:02, 5 January 2013 (UTC)
Sure — just fixed that, too. odder (talk) 22:28, 5 January 2013 (UTC)
Appreciated. Huji (talk) 23:22, 5 January 2013 (UTC)

{{Editprotected}} Please apply this per Wikidata:MediaWiki:Common.css

html[lang=fa] body, [lang=fa] {
  font-family: Tahoma, 'Iranian Sans', 'DejaVu Sans', sans-serif;
}

This is just a little improvement for above request. Thanks. −ebraminiotalk 14:11, 1 August 2013 (UTC)

Isn't :lang(fa) closer to what you try to achieve? -- Rillke(q?) 23:04, 7 August 2013 (UTC)
Hmm. Yes, I think so. −ebraminiotalk 23:15, 7 August 2013 (UTC)
This section was archived on a request by: whym (talk) 00:39, 29 September 2013 (UTC)

GeSHi fontsize fix

{{Edit protected}}

Moved from MediaWiki talk:Vector.css

Please add the following to Common.css. Since r69335/r69336 is now live, most monospace text is now fixed, with the exception of GeSHi. This will fix the monospace font size for GeSHi formatted text as well. Edokter (talk) — 16:00, 4 May 2011 (UTC)

/* Fix so <syntaxhighlight> tags and .css and .js pages get normal text size.
   [[Bugzilla:26204]] */
div.mw-geshi div,
div.mw-geshi div pre,
span.mw-geshi,
pre.source-css,
pre.source-javascript {
  font-family: monospace, "Courier New" !important;
}
✓ Done. – Adrignola talk 18:42, 4 May 2011 (UTC)
I forgot the explanatory comment. Could you add that? Edokter (talk) — 18:52, 4 May 2011 (UTC)
✓ Done For the record, the comment "Fix so <syntachighlight> ..." has been added there. --whym (talk) 12:09, 6 October 2013 (UTC)
This section was archived on a request by: whym (talk) 12:09, 6 October 2013 (UTC)

Image transparency on hover

Mediawiki 1.19 will have the default behaviour of the main image thumb on file pages becoming transparent when hovered. Currently the transparency is permanent. If Commons would want to follow the new default behaviour, then all that is need is to change #file img to #file img:hover. Edokter (talk) — 20:19, 25 November 2011 (UTC)

I oppose. Fry1989 eh? 20:03, 3 December 2011 (UTC)
When you say "Currently the transparency is permanent." does that mean that the current MediaWiki (1.18) does something with transparency, or that in MW1.19 the transparency remains active after a thumb has been hovered over, even after the cursor is no long on the thumb? Rd232 (talk) 20:35, 3 December 2011 (UTC)
"Currently" means that transparency is now set static in Common.css. This CSS is incorporated in 1.19, added with the hover toggle. (1.18 does not show any transparency by default.) This means the main thumb becomes transparent (shows checkered background) when the mouse enters, but becomes opaque again when the mouse leave the image. You can see it working on enwiki here. Edokter (talk) — 21:07, 3 December 2011 (UTC)
Thanks. The behaviour in that example makes sense to me on Wikipedia; but here, I think any transparency should be permanently visible. Rd232 (talk) 21:11, 3 December 2011 (UTC)
I'm not so sure. Just as on Wikipedia, I imagine that someone will just want to look at a picture without the checkered background. As it is now, that requires one extra click. Edokter (talk) — 21:24, 3 December 2011 (UTC)
If you're looking for an image to reuse, it's important to understand its transparency, if it has any. For direct transclusion within Wikimedia, the transparency doesn't matter, but showing it is harmless. Rd232 (talk) 21:38, 3 December 2011 (UTC)
This section was archived on a request by: whym (talk) 12:09, 6 October 2013 (UTC)

Please restore red links

{{Editprotected}} Please remove the following:

/* Make username links in {{tl|Information}}'s Author field always blue */
/* No need to invite readers to create them - may rise confusion Move to Filepage.css when it becomes global */
#fileinfotpl_aut + td .new { color: #0645AD; }
  • Displaying a blue link makes the reader believe further information can be read by clicking on the link. The en:Principle of least astonishment should apply : It states that, when two elements of an interface conflict, or are ambiguous, the behaviour should be that which will least surprise the user; in particular a programmer should try to think of the behavior that will least surprise someone who uses the program, rather than that behavior that is natural from knowing the inner workings of the program. Transforming red links into blue links when everywhere else red links and blue links have a specific meaning is a total astonishment, explained nowhere on any help page.
  • This code seems to apply to any link within the |artist= field in {{Artwork}}, so it does not concern only username links.
  • As I mentioned at Commons:Help desk#Unexistent page displayed as blue link in Artwork template, on File:Sigurd and Fafnir (1906).jpg , Creator:H. Hinrichs is displayed as a blue link although it should be a red link. People may falsely believe that this is a legitimate blue link providing author information. If it were red, as should be, people would have a hint that there is something wrong with this name. Teofilo (talk) 21:03, 14 December 2011 (UTC)
  • "If it were red, as should be, people would have a hint that there is something wrong with this name"
    That's exactly why it was made not red. This is a file description page, not an article. Users are not encouraged (or even authorized in most cases) to create other user's user pages. And there is nothing wrong with someone not having a user page. User pages shouldn't be plain wiki pages, but that's a whole other story... I agree with the principle of consistency though, so blue maybe wasn't a good solution either. Just nothing here for the record / rationale. –Krinkletalk 23:53, 25 January 2012 (UTC)
This section was archived on a request by: whym (talk) 12:09, 6 October 2013 (UTC)

TOC with bullets rather than numbers

.utoc .tocnumber { display:none; }
.utoc #toc ul,
.utoc .toc ul {
  line-height: 1.5em;
  list-style-type: square;
  margin: .3em 0 0 1.5em;
  padding: 0;
  list-style-image: url(skins-1.5/monobook/bullet.gif);
}

--Cool out 08:38, 4 September 2006 (UTC)

Why to change numbers for bullets? I strongly oppose Sanbec 11:21, 5 September 2006 (UTC)

This isnt for all toc. This is strictly optional to be used on places like COM:DEL. --Cat out 06:55, 2 December 2006 (UTC)
 Not done I don't think this matters anymore. This looks like a tweak for monobook which has been made non default years ago. Please re-propose against the latest skin and css if necessary. --whym (talk) 11:49, 1 November 2013 (UTC)
This section was archived on a request by: whym (talk) 11:49, 1 November 2013 (UTC)

Please remove the broken font-family hack

Please remove the following rules from MediaWiki:Common.css:

/* Support for Template:IPA, Template:Unicode and Template:Polytonic.
 The inherit declaration resets the font for all browsers except MSIE6.
 The empty comment must remain.
*/
.IPA {
 font-family: Chrysanthi Unicode, Doulos SIL, Gentium, GentiumAlt, Code2000, TITUS Cyberbit Basic, DejaVu Sans, Bitstream Vera Sans, Bitstream Cyberbit, Arial Unicode MS, Lucida Sans Unicode, Hiragino Kaku Gothic Pro, Matrix Unicode;
 font-family /**/:inherit;
}
.Unicode {
 font-family: TITUS Cyberbit Basic, Code2000, Doulos SIL, Chrysanthi Unicode, Bitstream Cyberbit, Bitstream CyberBase, Bitstream Vera, Thryomanes, Gentium, GentiumAlt, Visual Geez Unicode, Lucida Grande, Arial Unicode MS, Microsoft Sans Serif, Lucida Sans Unicode;
 font-family /**/:inherit;
}
.polytonic {
 font-family: Athena, Gentium, Palatino Linotype, Arial Unicode MS, Lucida Sans Unicode, Lucida Grande, Code2000; 
 font-family /**/:inherit;
}

This is a very, very old hack which used to exploit a CSS parser bug in MSIE 6: When it worked, all browsers except MSIE 6 evaluated the inherit part, but MSIE 6 ignored it because of the empty /**/ comment.

This hack has been broken for ages precisely because of the sentence “The empty comment must remain”, because MediaWiki does remove all comments. See here. --Entlinkt (talk) 03:34, 26 April 2016 (UTC)

I concur that this code is broken; all browsers use inherit, so this is dead weight. There is also no point in removing the inherit; all modern browsers should be able to properly handle Unicode by now. -- [[User:Edokter]] {{talk}} 16:23, 30 April 2016 (UTC)
@Entlinkt and Edokter: Hack removed. Font families remaining. Aren't they required anymore? What is/was their purpose? -- Rillke(q?) 17:34, 30 April 2016 (UTC)
@Rillke: For the reason Entlinkt explained: it targeted IE6 only. Now you have enabled it for all browsers, which is bad! It may override the browsers choice for displaying Unicode and fail. As I said: today's modern browsers need no help at all in displaying Unicode (or any Unicode subgroup like IPA). Please remove it. -- [[User:Edokter]] {{talk}} 21:26, 30 April 2016 (UTC)
What a hackery! Thanks :-] -- Rillke(q?) 21:33, 30 April 2016 (UTC)
Thank you! -- [[User:Edokter]] {{talk}} 21:34, 30 April 2016 (UTC)
This section was archived on a request by: Rillke(q?) 21:33, 30 April 2016 (UTC)

prettytable

Is long time declared as deprecated (2009 or longer, see #Removing deprecated classes). So can we please remove this all now⁈?User: Perhelion (Commons: = crap?)  21:30, 23 June 2015 (UTC)

Guy, if this counter is zero, we can do this. Current 5.972 (So here are the script-, bot-tasks Commons:File description page regular expressions…)User: Perhelion (Commons: = crap?)  08:39, 16 September 2015 (UTC)
I instructed my bot to replace the deprecated class. --Steinsplitter (talk) 12:24, 16 September 2015 (UTC)
That's fine, you take all this regexps there? ;-) I see some namespace have only low impact (on Help nothing, so I recommend the clean first this namespaces).User: Perhelion (Commons: = crap?)  12:33, 16 September 2015 (UTC)
No – as far i know there is no up to date general cleanup script for pywikibot for commons. --Steinsplitter (talk) 12:41, 16 September 2015 (UTC)
Uh. Someone notified me that this table is higly used on dewp etc. So i think it is not a good iddea to remove it :/. --Steinsplitter (talk) 16:38, 16 September 2015 (UTC)
Hm* this has only so far to do with De, as the most usage comes from there (De people). de:Wikipedia Diskussion:Technik/Baustellen/prettytable und wikitable current ~37000 there. But this should not matter here⁉User: Perhelion (Commons: = crap?) 16:51, 16 September 2015 (UTC)
PS: the amount on De seems coming from a false bot run (mentioned in the CSS there). -- User: Perhelion 12:22, 5 February 2018 (UTC)
Next try (after 3 years): Commons:Village pump#Cleanup Common.css -- User: Perhelion 12:22, 5 February 2018 (UTC)
This section was archived on a request by: -- User: Perhelion 16:53, 19 August 2019 (UTC)

Clear galleries

table.gallery {
    clear: both;
}

to prevent floated images overlapping galleries — Omegatron 21:14, 4 May 2006 (UTC)

Hm can you give a quick example (I just want to have a quick look myself previous I add it to the style sheet so that we don't break anything else)? Arnomane 23:18, 4 May 2006 (UTC)
I noticed it on Image:Schottky diode symbol.svg. On my wide screen at home it looks fine, but on my lower-res work monitor, the floated image overlaps the gallery and looks real bad. If you resize your browser you should be able to see it:
Schottky diode schematic symbol
Adding the clear: both; moves the gallery down below any floated images:
Schottky diode schematic symbol
If it breaks something, it won't do anything major, and I'm sure we'll hear about it. It's not a big deal. — Omegatron 14:27, 5 May 2006 (UTC)

Ah I now see what you mean I'd like your change. Btw. I found some styles in common.css that apparently are useless (some of the unsorted). Can you have a look as well if they make sense (I don't want to remove anything and later someone complains...)? Arnomane 17:40, 5 May 2006 (UTC)

Actually, I just realized it always moves the galleries below floated images; not just when they overlap, so maybe I dislike my own idea...
Which ones do you think are useless? If they just aren't used on Commons much, there's probably no harm in leaving them in. Maybe people will want to use those features later... — Omegatron 22:45, 5 May 2006 (UTC)

Cleanup

{{editprotected}} I'm requesting some changes that I think are fairly trivial. Please remove:

  • <pre><nowiki> (simply not needed anymore)
  • AD/BC dates or CE/BCE dates stuff: it was copied from en.wikipedia.org (where it was later removed), but the corresponding templates {{ADCE}} and {{BCEBC}} were never even created here on Commons

Move to Mediawiki:Monobook.css:

  • #p-cactions #ca-addsection a and #p-cactions #ca-edit a

Move here from Mediawiki:Monobook.css everything not related to Monobook skin:

  • NavFrame stuff
  • .my-buttons stuff
  • #wpUploadDescription

While at Monobook.css, also please delete all .messagebox rules (they duplicate Common.css) and </pre> at the end.

It would also be nice to remove long comments (move to the talk page maybe?) and group similar rules together (such as all Mediawiki interface changes) ∴ Alex Smotrov 20:08, 10 October 2007 (UTC)

  1. <pre><nowiki> is still used on diffs (bugzilla:10871)
  2. AD/BC removed
The other requests are still pending.
Platonides 21:13, 15 October 2007 (UTC)

Removing deprecated classes

I think it would be more than safe now to remove some of our deprecated classes. I propose removing the following:

  • .notice
  • #disambig obviously in use
  • #spoiler
  • .hiddenStructure and .hiddenStructure- - bugzilla:17009
  • .metatag - never used I don't think

And maybe:

  • .Talk-Notice - should be gone by now, but I know it's still in use. All uses should be converted to use .messagebox.standard-talk.
  • "Bytecounter colours" - Don't even know what this is for.
  • .prettytable - yeah, there's still some usage out there
  • .plainlinksneverexpand - deprecated, probably should keep around a little longer

I didn't do any database scans yet; I'm posting this first in case anyone knows off hand if any of these are still needed. Rocket000 (talk) 07:53, 3 April 2009 (UTC)

Bytecounter colors are for the red and green numbers in Recentchanges and Watchlists. There are probably many users who think those are useful.
prettytable can probably be replaced by wikitable, and then removed. /Ö 22:02, 26 April 2009 (UTC)

Updated list. Rocket000 (talk) 18:43, 7 August 2009 (UTC)

✓ Done -- User: Perhelion 17:16, 19 August 2019 (UTC)

Word wrap in <pre>

To make text in <pre> tags wrap in modern browsers, the CSS 2.1 declaration "white-space: pre-wrap;" can be used. For compatibility with older browsers, however, this page recommends something like the following code:

pre.pre-wrap {
   white-space: pre-wrap;       /* CSS 2.1 */
   white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
   white-space: -pre-wrap;      /* Opera 4-6 */
   white-space: -o-pre-wrap;    /* Opera 7 */
   word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

These extra non-standard declarations can't be directly included in style attributes in wikitext, since HTML Tidy will strip them out, but they could be included in Common.css. They'd cause the W3C validator to complain, though, so I'd like to ask for some comments before adding them. Any opinions? —Ilmari Karonen (talk) 14:11, 21 July 2009 (UTC)

Why would you want to wrap at all inside a <pre>? Doesn't that go against the idea of <pre>? If lines get too long, why not wrap the <pre> in a <div style="overflow:auto;"> (or "overflow:scroll", I always forget which one it is)? Lupo 14:55, 21 July 2009 (UTC)
Source code. The particular use I had in mind is {{Viewsource}}, where one would really like the output to look as much like the contents of a <textarea> as possible, but it could also come in handy for other types of source code such as, say, User:MIMEStatBot/Source, File:Polyhedron with no vertex visible from center.png#POV-Ray source, or indeed this page itself or any other .css/.js pages. —Ilmari Karonen (talk) 15:13, 21 July 2009 (UTC)

I use {{Pre2}} for this... I guess those declarations aren't doing much good if they get striped out. Rocket000 (talk) 18:47, 7 August 2009 (UTC)

As a side note: white-space is CSS1, so there would be no need for all the other declarations. EdokterTalk 13:44, 16 December 2010 (UTC)

Format for hiddencat

{{Editprotected}} At Commons:Village_pump#Hidden_categories:_change_the_default_setting_for_logged-in_users, Rocket suggested to add:

#mw-hidden-catlinks{font-size:87% !important;}

to the stylesheet. Would this be the place to add it? I use it in my monobook skin since and it works fine. -- User:Docu at 20:44, 3 March 2010 (UTC)

✓ Done Commons:Village_pump/Archive/2010Mar#Hidden_categories:_change_the_default_setting_for_logged-in_usersKwj2772 (msg) 03:08, 13 March 2010 (UTC)
Thanks, it seems to work. I checked a file description page and a category page with all skins, logged-in and logged-out. Some skins don't seem to be quite up-to-date, but this has nothing to do with this change.
BTW, I made a request at bugzilla for the main point in the thread, but could it be that this can be done through css too? -- User:Docu at 03:26, 13 March 2010 (UTC)
It is possible to do it through css but it will show hidden categories to unwanted users. So it is not added. – Kwj2772 (msg) 03:36, 13 March 2010 (UTC)
Already now, any user can see the categories if overwrites the style sheet. If it was possible to switch it on for logged-in user only, it would solve have the problem. The other point would be to update user preferences in one way or the other. -- User:Docu at 03:43, 13 March 2010 (UTC)

Horizontal lists

Horizontal list seems to simplify a lot some of Wikipedia templates that are much more complicated on Commons. Can someone more familiar with CSS add them? Afterwards the code

<ul class="hlist">
*[[cat]]
*[[dog]]
*[[horse]]
</ul>

should show in a single line:

--Jarekt (talk) 04:25, 9 January 2013 (UTC)

A few corrections... The above will not display as one line, but the following will:
<div class="hlist">
*[[cat]]
*[[dog]]
*[[horse]]
</div>
Also, there is some code that would need to be put in MediaWiki:Common.js/IEFixes.js as well. See mw:Snippets/Horizontal lists for details. Edokter (talk) — 21:47, 9 January 2013 (UTC)
✓ Done Thanks User:Edokter, mw:Snippets/Horizontal lists was very useful, although I am not sure yet if it worked. --Jarekt (talk) 01:54, 10 January 2013 (UTC)
OK, hlists work now. --Jarekt (talk) 01:59, 10 January 2013 (UTC)
It works when used directly, but not in anynavboxes, as it is lacking the listclass/bodyclass parameters. {{Navbox}} badly needs updating. Edokter (talk) — 18:54, 10 January 2013 (UTC)
I am unfamiliar with that template. Can you update it? It is not protected. That template might not be used much. I needed hlists for Template:Authority control/sandbox. --Jarekt (talk) 19:28, 10 January 2013 (UTC)
Opps, {{Navbox}} is used on 26k pages. --Jarekt (talk) 19:31, 10 January 2013 (UTC)
I never noticed it wasn't protected. I'll see about updating it. Edokter (talk) — 21:16, 10 January 2013 (UTC)
Navbox is now ready for hlist. I only added the required classes for hlist; other updates from enwiki are not (yet) implemented, as that requires changes to Common.css as well. Edokter (talk) — 14:44, 1 February 2013 (UTC)

Updated (November 2013)

{{Editrequest}} Please update hlist to revision 4. A critical update has been made that resolved many IE issues. Code can be found at mw:Snippets/Horizontal lists. Edokter (talk) — 13:55, 17 November 2013 (UTC)

✓ Done. Thank you. -- Rillke(q?) 22:25, 17 November 2013 (UTC)

Transparent tables

In MW 1.16 tables have a white background color by default. This was to prevent heading underlines from shining through tables. This has been fixed in 1.17 and the background-color was removed. This has the advantage that in non-white scenarios (ie. in a DIV with class="toccolours" or in templates with a non-white background) the tables are no longer forcing a white area to be formed.

Over the years some templates may have gotten used to this white color in general and started to depend on it. Therefor I'm applying a manual coding to background-color:transparent on table elements so we have more time to spot any errors and catch them early, rather than being suprised when the new version is released. –Krinkletalk 23:41, 28 January 2011 (UTC)

Thumbnail whitespace

Thumbnail whitespace

Every thumbnail here has a little padding to the right and bottom (left-aligned thumbs) or padding to the left and the bottom (right-aligned thumbs). This is done by a container around the image that has a border (used as a padding) applied.

I think it's an improvement to make this border transparent, rather than white. On articles no difference wil be notable, and in templates it will be an improvement (see example on the right).

Please add the following code to the CSS-file :

/* Transparent instead of white thumb-containers (for on non-white pages or templates) */
div.thumb { border-color: transparent; }

-- --Krinkletalk 17:15, 17 March 2010 (UTC)

This section was archived on a request by: ~riley (talk) 08:59, 15 November 2019 (UTC)

External links icons removed

Hello! If this CSS adds or modifies icons shown after external links, you'll be interested in knowing that such icons have been removed from MediaWiki core, a change which will reach this wiki in few days. You may want to consider whether you still need them. If you have questions, please ask at bugzilla:63725. Regards, Nemo 09:45, 10 April 2014 (UTC)

Please remove broken rules for Special:Upload

The following rules (currently lines 195 to 203) should be removed:

/* Show a border for warning messages on Special:Upload */
#wpDestFile-warning {
 padding-bottom: 0;
}
#wpDestFile-warning ul {
 margin-left: 0;
 border: 1px solid #f00;
 padding: 1.5em;
}

In the past, these rules were used to highlight the warning from MediaWiki:Fileexists when re-uploading a file, but this has been broken since rev:60875 in 2010 because the markup changed so much that the rules did not apply anymore.

Since gerrit:285711, which has been deployed just a few hours ago, the warning message is highlighted by default. Now the first rule has become active again and just breaks the bottom padding of the new box. --Entlinkt (talk) 22:16, 5 May 2016 (UTC)

✓ Done--Ymblanter (talk) 22:28, 5 May 2016 (UTC)

Edit request

{{Edit request}}

I suggest this following code be added:

/* Remove bullets when there are multiple edit page warnings */
ul.permissions-errors > li {
	list-style: none none;
}
ul.permissions-errors {
	margin: 0;
}

Because when the page is fully protected, template protected, or semi protected, then transcluded in a cascade protected page, there's only 1 message, and a bullet. That's why. Thank you! 64.114.239.29 21:14, 5 September 2019 (UTC)

It is not clear what for a glitch you mean (screenshot?). Anyway it should be fixed on the message templates. -- User: Perhelion 15:13, 10 September 2019 (UTC)
I think the request should be fulfilled or I'll ask an admin to block you. So do it! 64.114.239.29 15:26, 10 September 2019 (UTC)
 Not done ~riley (talk) 00:51, 13 October 2019 (UTC)

Removing prettytable

I replaced "prettytable"s with wikitable a few days ago. I checked all: insource:prettytable, and most of prettytable usages are replaced. Now, it's the time to remove prettytable from Common.css – Kwj2772 (talk) 13:43, 19 August 2019 (UTC)

Hey Kwj2772, thank you. Unbelievable that the time has finally come! -- User: Perhelion 15:44, 19 August 2019 (UTC)
Yepp :) Seems fine to me, i think we can remove it. --Steinsplitter (talk) 15:57, 19 August 2019 (UTC)

CSS for note lists

{{Edit protected}}

Could this CSS be added to the page? This was copied from this discussion about English Wikipedia's Common.css and allows reference lists to be numbered A, B, C; i, ii, iii; etc..

div.reflist ol.references {
	list-style-type: inherit;  /* Enable custom list style types */
}

Thanks, Jc86035 (talk) 16:30, 23 March 2018 (UTC)

@Jc86035: Do you have an example of use of custom list style types on that project?   — Jeff G. ツ please ping or talk to me 08:58, 25 April 2018 (UTC)
@Jeff G.: See w:en:Template:Notelist and w:en:Template:Reflist/Transwiki guide. Jc86035 (talk) 09:02, 25 April 2018 (UTC)
@Jc86035: Thanks. Have we met all the other requirements?   — Jeff G. ツ please ping or talk to me 09:11, 25 April 2018 (UTC)
@Jeff G.: All the other pages appear to exist. I now think it might be better to use the CSS block from w:en:Template:Reflist/Transwiki guide, but otherwise no additional action should be needed. Jc86035 (talk) 13:53, 26 April 2018 (UTC)
Jeff G., can you copy the CSS block at the bottom of w:en:Template:Reflist/Transwiki guide onto the page? Thanks, Jc86035 (talk) 11:37, 29 April 2018 (UTC)
@Jc86035: No, sorry. "In order to prevent vandalism, only administrators are allowed to edit system messages."   — Jeff G. ツ please ping or talk to me 11:50, 29 April 2018 (UTC)
@Jeff G.: Wait, if you're not an admin, why did you respond to the request? Jc86035 (talk) 11:51, 29 April 2018 (UTC)
@Jc86035: Because it was there. Sorry if I misled you.   — Jeff G. ツ please ping or talk to me 12:10, 29 April 2018 (UTC)
@Jc86035: ✓ Done. Jeff G., thanks for clearing things up, that was helpful. Sebari – aka Srittau (talk) 17:34, 29 April 2018 (UTC)
@Srittau: Thank you for making that happen. @Jc86035: Thank you for suggesting and explaining.   — Jeff G. ツ please ping or talk to me 17:40, 29 April 2018 (UTC)

Navbox too wide

{{Edit request}}

I just noticed that all Navboxes are 8 pixel too wide because the CSS class definition for navbox sets "width: 100%;" but misses the "box-sizing: border-box;". Example: Category:Nature of Austria. Maybe somebody with write access here can fix this? Thanks --Reinhard Müller (talk) 12:54, 4 November 2019 (UTC)

✓ Done Good catch. Verified through en:MediaWiki:Common.css to ensure we were hitting the mark on this. Template:Navbox is now reflecting the improvement. Thank you! ~riley (talk) 08:53, 15 November 2019 (UTC)
This section was archived on a request by: ~riley (talk) 08:54, 15 November 2019 (UTC)

Diff Styles

We intend adding

@import url('//bits.wikimedia.org/commons.wikimedia.org/load.php?modules=mediawiki.action.history.diff&only=styles');

for Module:Diff, Template:TextDiff, Template:StringDiff.

This has the advantage that the user will still see the "diff" in their custom, preferred way (e.g. if they have MediaWiki:Gadget-DiffOldStyle enabled). It will add 1 XHR loading 490 Bytes of content. Please comment. Suggestions for a better solution are welcome. -- Rillke(q?) 22:52, 7 August 2013 (UTC)

You would have the same affect by just adding the CSS to Common.css; saves a XHR request. Would it not be more efficient to load the stylesheet through the module dynamically? Edokter (talk) — 13:43, 29 September 2013 (UTC)
Today, we could even use a top-loader-default gadget with a dependency to mediawiki.action.history.diff. But this seems to be overkill. I think it's better to stick to inline CSS; there would be no maintenance benefit copying and pasting to Common.css so this is also not the best option. -- Rillke(q?) 18:08, 6 October 2013 (UTC)
How would that be overkill? A default gadget is more efficient then @import as everything goes through RL. Also, CSS is always top loaded. Edokter (talk) — 11:53, 30 April 2014 (UTC)
CSS is loaded twice AFAIK. CSS for a template that is rarely used. I'd call this overkill and stay with inline CSS. -- Rillke(q?) 13:44, 30 April 2014 (UTC)
bits.wikimedia.org has been deprecated by now: phab:T107430. whym (talk) 12:05, 17 October 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. whym (talk) 12:05, 17 October 2020 (UTC)

Wikivoyage's Banner

Hello,

I would like to use voy:Template:Pagebanner on Commons. The code was imported (Template:Pagebanner). This template requires some code in MediaWiki:Common.css to display the TOC in an horizontal list.

I've started a discussion on Village Pump to obtain a consensus about that modification. Unfortunately, there has not been a lot of participants.

Could someone add the code from voy:MediaWiki:Common.css ? The code needed is listed in voy:Template_talk:Pagebanner#Using_this_template_on_el:. Pyb (talk) 07:16, 25 April 2014 (UTC)

That's a lot of code; all of .topbanner needs to be copied. Could use some refinement and optimization. Edokter (talk) — 10:18, 26 April 2014 (UTC)
ok, thanks. I'll try to find some help. Pyb (talk) 10:56, 30 April 2014 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. whym (talk) 12:05, 17 October 2020 (UTC)

[Performance] certain elements on Main Page

[Performance] Hide certain elements on Main Page via css instead of JavaScript@Krinkle: I mean this is not an improvement for performance, as long this is not an option for individual deactivation. Also this global Common.css should never be for a single page (I never visit the Main Page), this is more an overkilling performance hack. MediaWiki:MainPages.js declares to be an superseding script for the MediaWiki:MainPages.css style sheet!? What is in reality the reason for this global hack? Anyway can we made this please optional?User: Perhelion (Commons: = crap?)  18:49, 23 June 2015 (UTC)

@Perhelion: "MainPages.js/css" is not a concept part of the software. It's custom-made for Commons and loaded with JavaScript from MediaWiki:Common.js. The old MediaWiki:MainPages.css stylesheet was also loaded by importing from Common. As such, it incurs an extra HTTP roundtrip when viewing the Main Page (and those roundtrips can add up to bad performance).
Common.js contained a small snippet of code that decided whether the current page is the Main Page and then loads that stylesheet (that snippet, naturally, is sent to all users on all pages) – that snippet is about the same size as actual stylesheet in question. As such it made more sense to embed it directly in Common.css. We either send one snippet to all pages, and a second for the Main Page; or just one snippet everywhere. More importantly, these extra non-standard scripts are loaded with a delay (because of how browsers work). As such, they always arrive too late, after the page has already been initially rendered in the user's browser. This performance enhancement preloads the relevant styles and ensures pages are rendered correctly the first time. This reduces the time it takes to render the Main Page for users, whilst not slowing down other pages.
As for loading styles that don't affect you. It's about balance. We can't tailor stylesheets for every user and page separately. That would make performance significantly worse by not sharing any resources between visits and downloading new resources every page. That doesn't scale for big websites. Besides, you can (and most likely will at some point or another) visit the Main Page. And when you do, it should render properly. Without any flashes, shifts, or jumps. I'd say don't worry about it. Also, remember that all stylesheets and scripts are minified and compressed by the server before being sent to your browser. We have much much bigger fish to fry. –Krinkletalk 19:57, 23 June 2015 (UTC)
Hm* ok, thanks for the detailed answer, then I'll trust your knowhow in this.User: Perhelion (Commons: = crap?)  21:12, 23 June 2015 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. whym (talk) 12:05, 17 October 2020 (UTC)

mw-hidden-cats-user-shown

{{edit protected}}

To implement Bugzilla:22689, I'd like to add a visible property to "mw-hidden-cats-user-shown" for logged in users. Possibly this could be limited to file namespace. (Note: in category namespace, categories with the "_ HIDDENCAT _" property, have always been visible). Not sure, how this needs to be done though. --  Docu  at 10:42, 19 June 2011 (UTC)

It is not possible to distinguish between all users and logged-in users in CSS. Also, adding this would add it for all users, and logged-in users would not be able to disable the display of hidden cats from preferences. Edokter (talk) — 16:56, 19 June 2011 (UTC)
Can we limit it to file description pages? --  Docu  at 17:30, 19 June 2011 (UTC)
It is not currently possible in CSS; there is a MediaWiki revision in the works to give logged-in users separate CSS from anons (it's already done, will probably turn up live some time in the autumn). In the mean time, JavaScript can do it: see en:User_talk:Gary_King#User:Gary_King.2Fuser_groups.js. Rd232 (talk) 17:45, 19 June 2011 (UTC)
The question was if the visible property can be limited to file description pages. --  Docu  at 17:48, 19 June 2011 (UTC)
I wasn't replying to your question, which I don't know the answer to. Rd232 (talk) 18:44, 26 August 2011 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. whym (talk) 23:10, 22 November 2020 (UTC)

Suggestion to center characters inside boxes for Edittools options while editing

Per this report of mine on Phabricator, I would like to make a request. We could use the following code:

   .wikiEditor-ui-toolbar .sections .section {
   line-height: normal !important;
   }

This is so that there can be a fix for the characters being slightly outside those boxes for the options on the Edittools tab on the Editor. For now, until this is implemented, however, you'll have to create a page titled something like "User:Your username/common.css" (without quotation marks). Here's mine for example.

The next time you open the Editor, you'll need to follow the directions on the page to see the fix.

Feel free to share your thoughts on this at any time. Thanks. DLindsley Need something? 21:40, 12 December 2014 (UTC)

✓ Done - Special:Diff/142522870

Please purge your browser’s cache. (You only need to do it once.)

Operating
system

Browser
Microsoft Windows or Linux macOS
Internet Explorer Press Ctrl+F5
Mozilla Firefox Hold down  Shift while clicking Reload
(or press Ctrl+F5 or Ctrl+ Shift+R)
Press  Cmd+R (reload page) or
 Cmd+ Shift+R (reload page and rewrite cache)
Opera Press Ctrl+F5 or  Shift+F5
Konqueror
Apple Safari Hold down  Shift+Alt while clicking Reload
Press Ctrl+R Press  Cmd+ Option+E (clear browser cache)
or  Cmd+R (update)
Chrome Press Ctrl+F5 or  Shift+F5
or hold down  Shift while clicking Reload
Press  Cmd+F5 or  Shift+F5
or hold down  Shift while clicking Reload
-- Rillke(q?) 23:20, 12 December 2014 (UTC)
This fix is targeting the wrong elements. Here's a better fix:
/* Workaround for WikiEditor booklet page characters breaking out of their faux insert buttons. [[Phabricator:T78354]] */
.wikiEditor-ui-toolbar .page-characters div span {
    line-height: 1;
}
I have posted a more permanent fix at Phabricator as well. -- [[User:Edokter]] {{talk}} 09:00, 14 December 2014 (UTC)
Done. Thanks :) --Steinsplitter (talk) 09:20, 14 December 2014 (UTC)
If this fix is applied, it should go into MediaWiki:Common.css. MediaWiki:Edittools.css is for edit tools only. Is this issue already tracked in Phabricator (I mean the general issue that text is advancing out of all edit buttons in Vector?) -- Rillke(q?) 09:27, 14 December 2014 (UTC)
That indeed needs to go into Common.css; Edittools.css is totally unrelated. Phapricator link is at the top. -- [[User:Edokter]] {{talk}} 09:48, 14 December 2014 (UTC)
Thanks for re-opening the task. -- Rillke(q?) 20:28, 14 December 2014 (UTC)
line-height: 1; is the optimal setting in my view as well -- just not 100% sold about the exact element/attribute it should go under in this specific case is all. -- George Orwell III (talk) 11:01, 14 December 2014 (UTC)

It should go under the same element that sets the font-size. That is the only way to ensure proper line-height, and avoids specificality issues (no !important needed). -- [[User:Edokter]] {{talk}} 15:14, 14 December 2014 (UTC)
I still get the impression we're talking past each other... leaving out the booklet[.page] section name[-Edittools1] on purpose in the here & now only complicates things for the unknowing future developer in my opinion.

I understand you think that's a fix -- cause it sure does work -- while covering both the Edittools & Special characters drop down menus at the same time -- but that assumes there will never be a span under a div under another div with a .page class all under .wikiEditor-ui-toolbar that's not an insertable-character faux-button ever. You know what they say re: assUme :)

The proper work-around would be to further narrow the effected elements &/or attributes down to the specific type of booklet-page [characters in this case as now reflected above] to avoid such pitfalls while moving forward in development;

the proper fix would be to add the line to the WikiEditor extension itself -- avoiding the MediaWiki:Common.css or MediaWiki:Edittools.css question altogether -- since whoever managed to load EditTools into WikiEditor mirrored that .page-characters class already in use by the Special characters booklet (2 birds, 1 stone). Visit the Phabricator for the latter. -- George Orwell III (talk) 17:30, 14 December 2014 (UTC)

"Special characters" page showing same problem as Edittools
Yes, I am talking about 'Special characters'. And while the 'literal' path above will fix the problem as it matches the current selectors, if this patch is to be incorporated into the EditTools extention, it will simply have to be added to the code that adds the font-size. That will automatically make it future-proof. Currently, the rules (and selectors) are probably generated dynamically (for every page, so I changed it back); the above patch is just a temporary local fix for all pages, until the problem is solved in the extention. I don't have the repo at hand, otherwise I could point what to add where in an instant. -- [[User:Edokter]] {{talk}} 21:59, 14 December 2014 (UTC)
No, every booklet section dealing with character sets comes from the same .css entry regardless of how many sections or groups or languages get built (that's why Special characters is delay loaded; note the spinner .gif upon selection). The same .css also sets font-size: (to 1.25em only to be curtailed by a height setting of 1.0em) but all that is irrelevant for our purposes. In the end, EditTools minus an enabled WikiEditor is also a moot point. When both are in play, .page-characters governs.

Also, the Help booklet doesn't "end" with DIV, DIV SPAN like the character set based booklets do but is built using a DIV, TABLE, TABLE-CELL premise (Fixed column widths in percentages is the issue there) so none of this has any bearing on any other page, section, tool or group in WikiEditor except those that specifically deal with inserting characters/simple templates (as far as I can tell).

And I can see what you mean now after I retarded my settings a bit and took a look at some of the more obscure & RTL language sets in WikiEditor; some of the tildes, accents & similar definitely show the mis-alignment(s) and begin to bleed outside of the faux button borders; but the EditTools variant is/was far worse than in Special characters. Still, apologies for not picking up on that nuance sooner. -- George Orwell III (talk) 22:32, 14 December 2014 (UTC)

That clears it up. I somehow mislooked and thought each page had its own class. Anyway, all that is needed in the extention is to add the line-height. And the local fix works just as well.
I don't see any problem in the help booklet; they don't have fuax borders. -- [[User:Edokter]] {{talk}} 22:53, 14 December 2014 (UTC)
P.S. I have the fix live at enwiki, so you can check there (but we don't have an option to move edittools to the WikiEditor). -- [[User:Edokter]] {{talk}} 22:56, 14 December 2014 (UTC)
Looks as least as good as before and without including any index or pages that also happen to use the straight .page class. Plus Wikipedia, for the most part, has opted for CharInsert over EditTools at this point -- though the .js induced edit notice doesn't really stop anything in MediaWiki:Edittools from lurking about & running; unless its empty -- not hidden -- it will still "run".

I'm still clueless on how Commmons manages to take EditTools from the vanilla, loads under the Edit options form when only the Classic toolbar is enabled to incorporating it into a booklet for WikiEditor "on-the-fly" when that toolbar is enabled instead. -- George Orwell III (talk) 23:29, 14 December 2014 (UTC)

It's all done in MediaWiki:Edittools.js (loaded from Common.js). It check the user's toolbar preferences and either creates the 'classic' edittools or moves it to WikiEditor. -- [[User:Edokter]] {{talk}} 08:11, 15 December 2014 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. whym (talk) 23:10, 22 November 2020 (UTC)

Authority Control template

@Jarekt: FYI, your recent edit here (changing hlists) kind of broke the display of the authority control template... it's now showing bullet points between empty fields. See below, for example, or just about any invocation of it. Fixies? Revent (talk) 09:54, 10 November 2015 (UTC)

Authority control
Hmm. I have no idea why the old version don't show them. The current cause of this is that line 374: .hlist li { display: inline; } overrided mediawiki.raggett.css: .mw-empty-li { display: none; }, causing the item to display. I'm working on it. --Zhuyifei1999 (talk) 10:21, 10 November 2015 (UTC)
✓ Fixed Special:Diff/178689020, mw:Special:Diff/1936288 --Zhuyifei1999 (talk) 10:33, 10 November 2015 (UTC)
Note: The problem also happened on Czech Wikipedia (Template_talk:Authority_control#Empty_parameters) --Zhuyifei1999 (talk) 11:18, 10 November 2015 (UTC)
Revent update of hlists to the current revision, as used on other wikis, was an attempt to fix the problem with hlists not a cause of it. Luckily Zhuyifei1999 fixed it. Thanks --Jarekt (talk) 13:13, 10 November 2015 (UTC)
@Jarekt: Yeah, wasn't 'yelling at you', just pointing out that it was causing things to look odd... I noticed it a few days ago, took me a bit to figure out why. @Zhuyifei1999: Thanks for fixies. :) Revent (talk) 13:19, 10 November 2015 (UTC)
Please undo this "fix"; hlist is not the cause of this problem, but it is used to fix it. However, that means hlist no longer behaves like regular wikilists, which is disruptive; hlist must behave as expected, including displaying empty list items. They are forced hidden with no method of showing them. If you won't fix the template, then at least change CSS to affect only the autority control template. -- [[User:Edokter]] {{talk}} 21:44, 13 November 2015 (UTC)
 Oppose MediaWiki itself hides empty list items. No reason for hlist to overwrite this behaviour. Please keep this discussion within mw:Talk:Snippets/Horizontal_lists --Zhuyifei1999 (talk) 03:30, 14 November 2015 (UTC)
The CSS hides all empty list items, not just hlist ones. To point I'm trying to get across it that they should act in sync; both or neither should hide them. -- [[User:Edokter]] {{talk}} 12:26, 14 November 2015 (UTC)
Wut? Let me make the situation clear:
  • mediawiki.raggett.css (MediaWiki core) hides items marked with ".mw-empty-li", that is, all empty list items.
  • MediaWiki:Common.css line 374, summarized as .hlist li { display: inline; }, is more specific than ".mw-empty-li", declares all list items in hlist should be visible. This hlist renderings.
  • The patch I have added (.hlist .mw-empty-li), is even more specific than simply ".hlist li", and make hlist behaviour in sync with mediawiki core behaviour.
As hlist is the cause of the problem, summarized in second point, I recommend hlist not to overwrite MediaWiki default behaviour, and the patch not reverted it until some day "mediawiki.raggett.css" is removed. --Zhuyifei1999 (talk) 13:57, 14 November 2015 (UTC)
The CSS is new to me; it wasn't there when I checked. It does change matters. The added CSS is correct. -- [[User:Edokter]] {{talk}} 19:24, 14 November 2015 (UTC)
I'll add that if they used li.mw-empty-li for the selector, this would not be needed. -- [[User:Edokter]] {{talk}} 19:27, 14 November 2015 (UTC)
 Support I rewrote {{Authority control}} template so this feature of hlist is no longer needed. --Jarekt (talk) 04:23, 14 November 2015 (UTC)
There may be other uses that's not so common, yet still may have empty list items. (I haven't looked into them though) --Zhuyifei1999 (talk) 04:42, 14 November 2015 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. whym (talk) 23:10, 22 November 2020 (UTC)


Add rule for unicode countrymap markers used by Template:Countrymap

{{Edit request}}At present Template:Countryonmap uses inline css to colour the unicode char map-marker to a custom color (darkred). Afaik it is not possible to modify :hover style attributes this way. It would be needed to remove underlining of the markers when mouse-hovered.

Previously, and for long, that template had used File:Locator Dot.svg image to achieve the same affect. One advantage using the text symbol is that the locator dot graphic is not loaded by the clients anymore (less network traffic, faster display on client); another may be that the markers can be styled further by user's Common.css settings by overriding the site-wide setting proposed below.

Thanks in advance for applying the css snippet below to MediaWiki:Common.css. Note that this addition will not affect appearance of Template:Countrymap immediately. Intention is to move class="tl-countrymap-marker" from the span to the div-Element in Template:Countryonmap thereafter and remove some of the inline css. Prior to this, MediaWiki:Common.css needs the proposed change below.

The code has been tested to achieve the desired results locally. The addition won't conflict with the current state of the template(s) mentioned. --93.201.163.245 02:29, 7 January 2020 (UTC)

.tl-countrymap-marker a {
  color: darkred;
  font-family: sans-serif;
}
.tl-countrymap-marker a:hover {
  color: #c04040;
  text-decoration: none;
}
✓ Done I will leave it to you to make the necessary modifications to Template:Countrymap. ~riley (talk) 05:24, 7 January 2020 (UTC)
Thanks, works. Should some users not like the highlight on mousehover, putting .tl-countrymap-marker a:hover { color: darkred; } in their Special:MyPage/common.css restores the previous, completely static behavior (just mentioning for completeness). --91.55.161.142 11:57, 7 January 2020 (UTC)
@Riley: Please note that these kinds of changes should go into template styles blocks in future, rather than bloating the main site CSS for all pages. Jdforrester (WMF) (talk) 18:36, 7 January 2020 (UTC)
Moved to templatestyles. ~riley (talk) 00:14, 8 January 2020 (UTC)
@Riley: I was not aware of templatestyles, but its in use now, see Template:Countrymap/styles.css, and works transparently to the Common.css placement. Issues with broken display in Category:People by country (and possibly with other callers passing newlines in the third positional argument) have been fixed. Please delete Countryonmap/styles.css. If you still find issues, broken usage of the template, look at the way argument passing is done (try passing using named arguments for example, |2= which string trims parameter values opposed to positional arg passing), or simply report the issue to Template_talk:Countrymap, thanks. --91.55.162.234 06:03, 8 January 2020 (UTC)
Thanks. Wanted to ping you when I noticed it was broken but uh.. you don't exactly have an account. Deletion request processed. ~riley (talk) 08:38, 8 January 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. whym (talk) 23:10, 22 November 2020 (UTC)

Unbreak thumbnails at Special:Search

{{Edit request}} Please add the following code:

.searchResultImage-thumbnail .image img {
   object-fit: contain;
   object-position: center;
   border: none;
}

This is to locally override a change made to mediawiki that lets thumbnails displayed at Special:Search appear cropped to square format (developers were trying to improve Wikipedia but this does not make sense for Commons). Relevant discussion is at the Commons:Village pump/Technical# Did the Special:Search display change and break? (permalink). This solution was suggested (and code provided) by Mmullie (WMF) at phab:T320459. El Grafo (talk) 09:46, 14 October 2022 (UTC)

@El Grafo I added the CSS snippt, but does it work? I don't see any improvement. Raymond 10:34, 14 October 2022 (UTC)
@Raymond Works fine for me! Thanks a lot! El Grafo (talk) 10:51, 14 October 2022 (UTC)
@El Grafo Ah now. Fine :-) Raymond 10:53, 14 October 2022 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Thanks! El Grafo (talk) 10:58, 14 October 2022 (UTC)