Edgewall Software

Opened 16 years ago

Last modified 8 years ago

#6158 new enhancement

Use separate, multiple CSS classnames to enable more versatile stylesheet customization

Reported by: robert@… Owned by:
Priority: normal Milestone: next-major-releases
Component: report system Version:
Severity: normal Keywords: css consider
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


Customizing CSS for trac reports is a bit difficult at the moment because semantically independent classnames are concatenated together in a single class.

For example, "color2-odd" reflects that a row is both at an odd index, and that it should have color2 applied to it. Thus, changing the even/odd color style requires defining at least 12 styles (6 colors X 2 even/odd values), as seen in the current report.css.

Generic Color Styling

If, instead, the classname were specified as "color_N odd", (where N indicated the cell value) then CSS rules could be specified like so:

.even {...}
.odd {...}
.color_1 {...}
.color_2 {...}
.color_6 {...}

Cell-Specific Styling

Furthermore, individual cells should have a class value that reflects both the cell name and cell value. For example, cells showing ticket priority should have a class of "priority priority_N" (where N is the priority value). E.g. the markup should look like this:

E.g. a cell could have class="priority priority_N", instead of just class="priority"

Backward Compatibility

Note that existing stylesheets can continue to be supported by simply including the existing stylenames as part of the 'class' attribute in the markup. To illustrate what this might look like for all of this …

<tr class="color2-odd odd color_2">
  <td class="id">...</td>
  <td class="subject">...</td>
  <td class="owner owner_is_user">...</td>
  <td class="reporter reporter_is_user">...</td>
  <td class="status status_4>...</td>
  <td class="priority priority_3">...</td>

Attachments (0)

Change History (3)

comment:1 by sid, 16 years ago

Keywords: css added

comment:2 by Christian Boos, 15 years ago

Component: generalreport system
Keywords: consider added
Milestone: 0.12
Owner: changed from Jonas Borgström to Matthew Good

Check also how it's done for the query module.

comment:3 by Ryan J Ollos, 8 years ago

Owner: Matthew Good removed

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment

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