GNOME Bugzilla – Bug 695931
Use monospace font for diff
Last modified: 2013-03-25 18:09:31 UTC
This would make understanding some changes such as switching from "..." to "…" easier to understand and approve.
It was changed during the theme refactor (https://git.gnome.org/browse/damned-lies/commit/?id=21a30ba682e19137122). I'm OK to change it back (unless there is a compelling reason not to), feel free to make the change.
I had a look and it's not as trivial as I had first thought. I added `font-family: monospace;` to .diff tbody (I'm working with difflib.css), which works as intended but the table becomes wider and on smaller screens it will create an horizontal scrollbar even though there's a huge left margin. What's more even if your screen is wide enough, there's still that huge left margin and the table isn't centered at all. So as a next step I tried moving just the table to the left. It appears that the only way to achieve this with our current HTML code is to apply a negative margin-left to table.diff, but then it gets worse for small screens: if your window isn't wide enough to display the full table and you get an horizontal scrollbar, it starts at 0 and you can't scroll to see the table part in the negative margin. I'd be tempted to try to "break" the template for the diff page and get the table out of the div so that it can be centered correctly, but somehow that sounds wrong. Any opinion?
So most gnome.org pages are built using 960 [1], with a max-width of 960px as indicated by the class called max-width that the table overfloats. This to ensure that our sites works on smaller resolution screens as well (still some percentage of our visitors run 1024x768 screens, but shrinking). The reason that monospace takes so much more space than Chantarell is because it's a much more slimmer font. The text should normally wrap in these situations, but all the td's are set to nowrap. Hence, in this situation, we will need to go for a smaller font-size to compensate. setting this should work: font-family: monospace; font-size: 10px; 1. http://960.gs/
Created attachment 239797 [details] [review] Use monospace for diff
I tested this. It's not perfect but I think it's better than what we currently have and it's not really possible to achieve what I wanted (centered table) without breaking the template (which is not a good idea). So… let's go with this, right?
Comment on attachment 239797 [details] [review] Use monospace for diff Thanks, go ahead
Pushed to master.