#12048 closed enhancement (fixed)
[PATCH] Add scope to CSS rules in timeline.css
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.1.5 |
Component: | timeline | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed timeline CSS rules interfering with styling of custom themes. |
||
API Changes: |
Timeline CSS rules are scoped to the |
||
Internal Changes: |
Description
The way the CSS rules are declared in timeline.css
makes it hard to integrate Trac into an existing design.
You can see an example in the footer of https://code.djangoproject.com/timeline (big gray rectangles).
I would propose to add a .timeline
prefix to the rules in the stylesheet to avoid this kind of problem.
Attachments (2)
Change History (15)
by , 10 years ago
Attachment: | timeline-css-scoping.diff added |
---|
comment:1 by , 10 years ago
Milestone: | → 1.0.6 |
---|---|
Owner: | set to |
Status: | new → assigned |
Thanks for the patch. I see no problem with applying some form of the patch for the upcoming release, but let's see what the other devs have to say.
A few comments:
- Which version of Trac are you running on the Django site? The patch applies cleanly on the trunk, but not on 1.0-stable.
- The nested CSS would be much easier to manage if we were using something like Sass to generate our CSS, something the Trac project should keep in mind for the future.
- An alternative to using the class selector, we could use the
#content
selector. The reason I mention that is that equivalent changes could then be applied toreport.css
,roadmap.css
, etc; resulting in a very consistent pattern that could be useful for sites that use a theme to make Trac appear nested in the page.
I'm glad to see the Django project still running Trac!
comment:2 by , 10 years ago
Regarding your comments:
- Django currently runs 1.0.5. I've attached a patch against the 1.0 branch as well.
- A CSS pre-processor would probably be really useful but it's a major undertaking. As a point of reference, the djangoproject website now uses SASS with libsass [1] and I find it works quite well.
- I haven't looked into some of the other CSS files but the reason I chose the
.timeline
prefix was that in case someone was relying on the global styling in their custom CSS, it would be easy to restore the old behavior by wrapping the site in a<div class="timelime">
.
And yes, we're still running our Trac instance and are approaching 25000 tickets. Trac has its warts (integrating it with our custom CSS was hard and running it locally is quite tricky), it's still a very solid bug tracker and an integral part of our project.
Thanks!
comment:3 by , 10 years ago
That changes seem to be good. However, it would lead a bit of incompatibilities to plugins which use the stylesheet, e.g. th:source:ticketmodifiedfilesplugin/0.11/ticketmodifiedfiles/ticketmodifiedfiles.py@11457:37#L28.
I think we should apply it on trunk.
follow-up: 5 comment:4 by , 10 years ago
Milestone: | 1.0.6 → 1.1.5 |
---|
Okay, let's apply to trunk.
The patch doesn't include .timeline
in the following rules: trunk/trac/htdocs/css/timeline.css@13937:55-63,66-67,70-71,76,86,89-94,102,106,110#L54. Should we also scope those rules to .timeline
for consistency, even though they already match to classes rather than just element type?
comment:5 by , 10 years ago
Replying to rjollos:
The patch doesn't include
.timeline
in the following rules: trunk/trac/htdocs/css/timeline.css@13937:55-63,66-67,70-71,76,86,89-94,102,106,110#L54. Should we also scope those rules to.timeline
for consistency, even though they already match to classes rather than just element type?
Yeah, I think we should scope all rules in timeline.css
to .timeline
. I consider that changes would be able to merge the timeline.css
to trac.css
and reduce requests to improve performance.
comment:6 by , 10 years ago
comment:7 by , 10 years ago
I'll also do some testing to do determine if we still need this rule ([997#file0]): tags/trac-1.1.4/trac/htdocs/css/timeline.css@:3.
comment:8 by , 10 years ago
Proposed changes in log:rjollos.git:t12048. I'll do a bit more testing in a few hours.
The rules removed in [a518966e/rjollos.git] and [7c2df7a8/rjollos.git] appear to apply to IE only for Document Mode 5. Tested with IE 11 on Windows 8 in emulation mode.
comment:9 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Changes committed in [14051].
comment:10 by , 10 years ago
Owner: | changed from | to
---|
comment:12 by , 8 years ago
The line dd.changeset .changes .add { background: #bfb }
was accidentally removed in r14051. Noted in gmessage:trac-users:UJJOQbm7bOo/XV48I3-QAwAJ.
comment:13 by , 8 years ago
Thanks!
I noticed this since a long time in my own Trac, and somehow I didn't bothered until I saw it this morning on TracHacks… then I knew it wasn't my local setup ;-)
Git-format patch