Modify

Opened 18 years ago

Last modified 10 years ago

#1652 new enhancement

Background color variations

Reported by: anonymous Owned by:
Priority: normal Component: NewsFlashMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Currently with the newsflash, the background is green. It would be nice to be able to change the background color to represent differing types of news.

Attachments (0)

Change History (5)

comment:1 Changed 17 years ago by Koen <werdlerk@…>

Totally agreed.

comment:2 Changed 16 years ago by Dimas Souza

Trac Release: 0.100.11

Hi,

I wish this issue solved too!!!

comment:3 Changed 15 years ago by MiG

The problem as I understand it is that this macros loads its CSS using javascript by placing this bit of html near the end of the page:

    <script type="text/javascript">
        jQuery.loadStyleSheet("/trac/chrome/newsflash/css/newsflash.css", "text/css");
    </script>

This causes two problem:

  1. style can not be overridden using site/style.css, which is the main issue here
  2. page first renders with newsflash content inline, then AFTER the pages loaded it runs javascript which loads CSS which causes page to re-render moving newsflash content to its float position, and all this is visible to the visitor and looks clunky.

Both problems would be solved properly if loading of the CSS could be done by referencing it from the html header, right after the Trac built in header code. Then it would be easy to override the styles in site/style.css as per wiki:0.11/TracInterfaceCustomization#SiteAppearance. But I have not seen Trac plugin APIs I can't say if Trac allows plugins messing with html <head>...</head> output.

Second best way around it would be to add a macro argument eg class=myCssClass and provide style for that class in site/style.css. Then default styles loaded by javascript would not apply and because site/style.css loads from the html head things would render nicely right away.

And finally, as a very dodgey workaround, I just re-aliased (Apache conf) the plugin's style sheet to an empty file. "Can we fix it?" Donno, but we can dodge it. :)

  Alias /trac/chrome/newsflash/css/newsflash.css .../trac-static/htdocs/site/dummy.css

comment:4 Changed 15 years ago by Ryan J Ollos

To be consistent with other macros, we'd want to use a notation such as #!color:red.

comment:5 Changed 10 years ago by Ryan J Ollos

Owner: Noah Kantrowitz deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.