A less invasive cgit.css that works in an embedded environment?

Lukas Fleischer cgit at cryptocrack.de
Fri Aug 26 17:28:00 CEST 2011

On Mon, Aug 22, 2011 at 08:47:47PM +0800, Delan Azabani wrote:
> Hi,
> I've been a long time user of cgit, but only recently have I
> attempted to integrate cgit into the style of the rest of my
> website. I have had some success so far, with the following
> configuration:
> 	snapshots=tar.xz tar.bz2 tar.gz tar zip
> 	scan-path=/var/git
> 	clone-prefix=git://azabani.com
> 	cache-root=/var/cache/cgit
> 	noheader=1
> 	embedded=1
> 	header=/var/www/head
> 	footer=/var/www/foot
> Specifically, the last four options are what I've used, and this
> works quite well, but styling is an issue.
> If I include cgit.css in /var/www/head, the styles in the file break
> other parts of my website, including non-cgit pages, but more
> importantly, the template itself, because the selectors being used
> are very general.
> I am wondering, is it possible to prepend '#cgit ' to all of the
> selectors in cgit.css so that it can work well in an embedded
> environment?

Why don't you just embed the whole cgit body in a container and use
selectors [1], [2] to make the cgit styles match elements of the cgit
interface only?

[1] http://www.w3.org/TR/CSS21/selector.html#descendant-selectors
[2] http://www.w3.org/TR/CSS21/selector.html#child-selectors

More information about the CGit mailing list