Last modified: 2012-09-27 01:11:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22706, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20706 - Monospace/preformatted text has gotten much smaller in Vector (code, tt, pre, kbd, samp)
Monospace/preformatted text has gotten much smaller in Vector (code, tt, pre,...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Normal enhancement with 2 votes (vote)
: ---
Assigned To: Nimish Gautam
http://en.wikipedia.org/wiki/Wikipedi...
:
Depends on:
Blocks: 23708
  Show dependency treegraph
 
Reported: 2009-09-18 00:06 UTC by Brion Vibber
Modified: 2012-09-27 01:11 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2009-09-18 00:06:10 UTC
Monospace text (code, tt, or pre tags) has gotten a lot smaller in recent versions of Vector; definitely getting complaints from Firefox and Safari users on Mac, haven't checked other platforms too much yet.

Also affects things like the source diffs in code review:

http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56574?useskin=vector
Comment 1 Phillip Patriakeas 2009-09-18 17:38:13 UTC
Also affects Google Chrome (3.0, not sure about earlier versions).
Comment 2 Nimish Gautam 2009-09-18 18:10:38 UTC
looks fine in IE and Opera on PC, FF is affected in Mac and Windows
Comment 3 Subfader 2009-10-18 16:46:24 UTC
It was the case ever since in Chrome and now in Vector. Tests:

http://www.mediawiki.org/wiki/User:Subfader/3
Comment 4 Subfader 2009-10-18 16:54:29 UTC
quick solution:

code {
  font-size:medium;
 }
Comment 5 Nimish Gautam 2009-10-23 22:54:33 UTC
setting the font size to medium fixes it on FF and Safari, but makes it huge in other browsers
Comment 6 Phillip Patriakeas 2009-10-24 17:22:25 UTC
Note discussion at http://en.wikipedia.org/wiki/MediaWiki_talk:Common.css#Teletype_style_fix_for_Chrome
Comment 7 Christian Thiele 2010-04-05 13:14:59 UTC
Could please someone have a look at this bug? Because of a bug in Firefox, <pre> tags are displayed much smaller.

This is fixed in Common.css on en.wiki and Vector.css on de.wiki, but will affect all other wikis when it will be rolled out to all sites. So please include this fix into the Vector skin.

On Commons it is fixed using "font-size:larger;" at the moment - so there are even fixes, that fix the firefox bug, but everything is wrong in other browsers... that's why you should include the correct fix in the vector skin.

The bug is the following. Normally the font-family property of "pre" is "monospace". In this case, Firefox uses a smaller font (I don't know why). A simple fix is to add another font: "font-family: monospace, sans-serif;". It is exactly the same (because the first is a generic font family and this is always used), but Firefox displays the correct font size. In fact it doesn't matter whats behind the comma, so even "font-family: monospace, bla;" will fix it (but this would be incorrect CSS).

So the fix is:
pre, code, tt {
font-family: monospace, sans-serif;
}
Comment 8 Trevor Parscal 2010-04-21 13:46:51 UTC
The font size issue is resolved in r65383.
Comment 9 Christian Thiele 2010-04-21 14:14:33 UTC
Sorry, but could you please read my comment above? The font size is only to small in Firefox and Chrome because of a bug in these browsers. So please fix it using

pre, code, tt 
{
font-family: monospace, sans-serif;
}

which in fact doesn't change anything according to the standard, but you get the correct size in Firefox. Putting "font-size: 1.25em;" will make the font in pre tags much to big for all browsers, which do not have this bug.

The second thing is, that you only fixed it for the pre tag, but not for code and tt, which have the same problem, I think.
Comment 10 Trevor Parscal 2010-04-21 14:19:56 UTC
Actually fixed in r65391. Sorry about that - I was being a little careless I suppose.
Comment 11 entlinkt 2010-06-25 21:36:45 UTC
This fix misses two elements that are monospace in the Default style sheet for HTML 4, kbd and samp, which causes them to remain tiny.

samp is inserted by the SyntaxHighlight GeSHi extension if an invalid language was specified, example: http://en.wikipedia.org/w/index.php?title=Special:ExpandTemplates&input=%3Csource%20lang=%22invalid%22%3E...%3C/source%3E

I have not seen any usage of kbd so far, but why not add it as well just in case.
Comment 12 entlinkt 2010-08-05 01:30:42 UTC
Related: bug 671
Comment 13 Internoob 2010-09-03 16:45:42 UTC
Problem affects me in FF and Safari 5 for Windows. IE7/8 is OK. Font is 80% the size of normal, but only affects pre tags, like those generated with &lt;source>, not other monospaces. Pre tags with no class attributes set seem to be normal. 

All this is observed on the English Wiktionary; it may differ for other wikis. 

See http://en.wiktionary.org/wiki/Wiktionary:Grease_pit#monospace_fonts_and_beta
Comment 14 entlinkt 2010-09-04 00:34:09 UTC
The problem with <source> tags is different; it is caused by the Syntaxhighlight GeSHi extension and really needs to be fixed there. Bug 23708 contains a workaround (used in [[de:MediaWiki:Geshi.css]]); maybe the English Wiktionary wants to copy that.
Comment 15 Erwin Dokter 2010-11-08 15:21:02 UTC
pre, code, tt 
{
  font-family: monospace, sans-serif;
}

This code is semantically incorrect, as sans-serif is not monospaced. As the 'trick' is to sepcify any font as the second parameter, I suggest changing it to the code below, based on another line in the same CSS files (font-family: serif, "Times New Roman";)

pre, code, tt 
{
  font-family: monospace, "Courier New";
}
Comment 16 Roan Kattouw 2010-11-08 15:30:26 UTC
(In reply to comment #15)
> pre, code, tt 
> {
>   font-family: monospace, sans-serif;
> }
> 
> This code is semantically incorrect, as sans-serif is not monospaced. As the
> 'trick' is to sepcify any font as the second parameter, I suggest changing it
> to the code below, based on another line in the same CSS files (font-family:
> serif, "Times New Roman";)
> 
> pre, code, tt 
> {
>   font-family: monospace, "Courier New";
> }
That's what Trevor did, see r69335 and r69336.
Comment 17 Erwin Dokter 2010-11-08 16:43:15 UTC
Ah OK, never mind then. Is there any reason why this big is still open then?
Comment 18 entlinkt 2010-11-08 16:51:09 UTC
Because the fix isn't complete (see comment 11).

I have reopened it because I'd like to get the kbd, samp { font-family: monospace, "Courier New"; } from [[de:MediaWiki:Vector.css]] upstream.
Comment 19 Phillip Patriakeas 2010-11-08 17:09:51 UTC
I added kbd and samp to the bug name; hopefully that'll draw a bit more attention.
Comment 20 Trevor Parscal 2010-11-08 18:20:55 UTC
kbd and samp were added to the rule in r76017.
Comment 21 Phillip Patriakeas 2010-11-08 18:28:48 UTC
All I see in r76017 are tweaks to the colors of .usermessage...
Comment 22 Trevor Parscal 2010-11-08 18:29:29 UTC
Oops... I meant r76322... Sorry.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links