After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 695931 - Use monospace font for diff
Use monospace font for diff
Status: RESOLVED FIXED
Product: damned-lies
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: damned-lies Maintainer(s)
damned-lies Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-03-15 16:58 UTC by Alexandre Franke
Modified: 2013-03-25 18:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use monospace for diff (725 bytes, patch)
2013-03-25 17:16 UTC, Alexandre Franke
accepted-commit_now Details | Review

Description Alexandre Franke 2013-03-15 16:58:15 UTC
This would make understanding some changes such as switching from "..." to "…" easier to understand and approve.
Comment 1 Claude Paroz 2013-03-15 17:37:16 UTC
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.
Comment 2 Alexandre Franke 2013-03-25 10:22:24 UTC
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?
Comment 3 Andreas Nilsson 2013-03-25 13:05:35 UTC
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/
Comment 4 Alexandre Franke 2013-03-25 17:16:11 UTC
Created attachment 239797 [details] [review]
Use monospace for diff
Comment 5 Alexandre Franke 2013-03-25 17:17:22 UTC
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 6 Claude Paroz 2013-03-25 17:29:21 UTC
Comment on attachment 239797 [details] [review]
Use monospace for diff

Thanks, go ahead
Comment 7 Alexandre Franke 2013-03-25 18:09:31 UTC
Pushed to master.