Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#5497 closed defect (worksforme)

Can't customize style of !BlogFlash

Reported by: Olaf Meeuwissen <olaf.meeuwissen@…> Owned by: osimons
Priority: normal Component: FullBlogPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I'm using the BlogFlash macro to create a NewsFlash like box on the WikiStart page of one of our projects and tried to change its style but to no avail. It seems that (one of) the add_stylesheet calls is responsible for

    <script type="text/javascript">
        jQuery.loadStyleSheet("/projects/utsushi/chrome/tracfullblog/css/fullblog.css", "text/css");
    </script>
    <div id="altlinks">
      <h3>Download in other formats:</h3>
      <ul>
        <li class="last first">
          <a rel="nofollow" href="/projects/utsushi/wiki/WikiStart?format=txt">Plain Text</a>
        </li>
      </ul>
    </div>

just before the alternative format downloads and that this overrides whatever I put in the project's site/style.css file. Note, other customisations in site/style.css do take effect so that file is found alright.

Using r4222 of the plugin with Trac 0.11.1. Modifying fullblog.css system-wide is not an option.

Attachments (0)

Change History (2)

comment:1 Changed 15 years ago by osimons

Resolution: worksforme
Status: newclosed

That sheet is added by the macro. Macros/processors in Trac render so late in the page-cycle, that they cannot add to <head>. That is why Trac adds them at the end of the page.

You can still override, as CSS rules are applied according to relative weight - where order is one of the inputs. Some things that may increase the relative weight of your styles are:

  • using more specific identification: div {} will have less weight than div.class1 div.class2 {}, so make your styles more specific than the one from the plugin
  • use the !important keyword on the individual styles to increase their weight

Read up on the rules of CSS weighting - I don't remember them all off-hand. However, if you do spot individual styles in the fullblog plugin that are too specific for practical override, I'll listen to feedback and change them if possible.

comment:2 Changed 15 years ago by Olaf Meeuwissen <olaf.meeuwissen@…>

Thanks! Using the relevant bit of CSS, I got things to work using

div.wikipage div.blogflash { /* style here */ }

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.