Edgewall Software

Opened 13 years ago

Closed 13 years ago

#7410 closed enhancement (duplicate)

Font sizes in CSS should be "em", not pixels

Reported by: anonymous Owned by:
Priority: low Milestone:
Component: rendering Version:
Severity: minor Keywords: css
Cc: Shevchenko, linuxadmin@… Branch:
Release Notes:
API Changes:
Internal Changes:


Pixel units in css files of trac are bad! I had to replace tens of ??px to get the whole interface slightly larger.

If we had "em" units, the page would be displayed correctly scaled (depending on system resolution (dpi)) in every modern browser. This is what "em" units are for, normally.

Furthermore, usage of "em" units is considered as better design.

Attachments (1)

css~~~.diff (15.0 KB ) - added by Ivan G Shevchenko <linuxadmin@…> 13 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Ivan G Shevchenko, 13 years ago

Cc: Shevchenko added
Keywords: text font fonts size sizes unit units css added

comment:2 by Ivan G Shevchenko <linuxadmin@…>, 13 years ago

Cc: linuxadmin@… added

comment:3 by Noah Kantrowitz, 13 years ago

If you have already done the changes, a patch would be nice.

by Ivan G Shevchenko <linuxadmin@…>, 13 years ago

Attachment: css~~~.diff added

comment:4 by Ivan G Shevchenko <linuxadmin@…>, 13 years ago

notes to my "patch":

the problem with replacing absolute (px) values with relative (em, %) values is: it's a different concept. if we have nested blocks with font-size 0.9em each, the nested blocks will become smaller and smaller, because the size is interpreted relatively to parent block.

i wasn't able to understand the whole "concept" behind trac's css files (IF there is a concept, which i doubt, seeing that sometimes 3 different font-size notations are used: %, em, [smaller|larger] ).

so i can't guarantee that nested blocks won't be displayed wrong. but as far as i can judge, the appearance is OK overall.

it would be great, if someone who is familiar with trac's css-"concept" could re-structure the whole thing ;)

i changed only font-size properties. following conversion was used: i set 12px to 1em, each pixel additional pixel being 0.1em, so that 14px would be 1.2em and so on.

comment:5 by Ivan G Shevchenko <linuxadmin@…>, 13 years ago

BTW: now, to change all font sizes, one has to edit just a single line!

it's line #3 of trac.css:

change 1em → 1.1em to increase all font sizes

change 1em → 0.9em to decrease all font sizes

(well, i hope, no one will decrease fonts, they're already pretty small in trac)

comment:6 by Piotr Kuczynski <piotr.kuczynski@…>, 13 years ago

Component: generalrendering
Keywords: text font fonts size sizes unit units removed
Milestone: 1.0
Priority: normallow
Severity: normalminor
Type: defecttask

comment:7 by Emmanuel Blot, 13 years ago

I remember a mail or a ticket comment from one Trac developer (cmlenz, mgood ?) writing about this topic.

I might be wrong, but I think it was about ex/em and the fact that they were badly supported. Before making any changes, it might be useful searching for this ticket.

comment:8 by Christian Boos, 13 years ago

Related tickets: #633 and #3575. The three of them (i.e. this one included) should probably be consolidated in #633, perhaps targeting an earlier milestone if someone steps up for handling this.

(Ivan: you should create your patches in unified diff format, e.g. by using svn diff. See TracDev/SubmittingPatches).

comment:9 by Christian Boos, 13 years ago

Milestone: 1.0
Resolution: duplicate
Status: newclosed
Type: taskenhancement

Closing as duplicate of #633.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.