Modify

Opened 7 years ago

Last modified 4 years ago

#1652 new enhancement

Background color variations

Reported by: anonymous Owned by: coderanger
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 (4)

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

Totally agreed.

comment:2 Changed 6 years ago by dimasfs

  • Trac Release changed from 0.10 to 0.11

Hi,

I wish this issue solved too!!!

comment:3 Changed 5 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 4 years ago by rjollos

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

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.