Custom CSS for Trac

I really love Trac – dont get me wrong – but red just isnt my color. So I made a couple halfhearted moves in the past to style my Trac installation (the one you are looking at atm sorry switched to WordPress for this Blog in the meantime, Redmine for issue tracking) a bit but always had a deja vú when stumbling across Trac: Customizing the Trac Interface as it – in my understanding – ment I had to learn the templating engine used by Trac (Genshi). Being a Python-noob myself investing a lot of time digging through sources wasn’t exactly desirable either.

Luckily Trac-Hacks.org hosts a plugin called ThemeEnginePlugin which allows replacing the default Trac theme with custom theme-packs. There are a couple pre-prepared theme-packs available at Trac-Hacks:Themes but half of them look broken (at Trac 0.11) and actually I was quite satisfied to find that the ThemeEnginePlugin allows you to append custom CSS to every Trac-page letting you overwrite whatever suits your needs in the default CSS definitions. Just remember to update your trac.ini (and restart apache afterwards) with

[theme]
enable_css = true

Thanks Noah Kantrowitz aka coderanger!

Ah yes – just as it took me a while to figure this out back then: inserting arbitrary html in Trac wikipages can be done with

{{{
#!html
HTML HERE
}}}

Leave a Reply