Page 1 of 1

Weird CSS compilation

Posted: Mon Sep 03, 2007 9:12 pm
by drx
Hi, i am using the freetag plugin and wrote special css to style its output.

However, as i found out, the plugin is inserting its own css into the stylesheet, and this CSS always comes after the CSS i wrote for my theme. So what i write gets overridden unless i use !important.

I think it is in general questionable if plugins should insert their own CSS like this, it makes it hard to unpredictable how things will look. If it is absolutely neccessary, i suggest that:

# The theme's CSS should be inserted LAST in the css chain, so it can override what plugins generated, without having to use !important

# It should be possible to switch off this CSS compilation in general and only use the theme's CSS. Like this, useless overrides could be avoided.

Bests,
drx

BTW, is there a place to report plugin-bugs?

Re: Weird CSS compilation

Posted: Tue Sep 04, 2007 12:03 pm
by garvinhicking
Hi!

The plugin does not append its own CSS if you declare ".serendipity_freeTag' in your custom CSS somewhere.

Most plugins add their own CSS at the top of the output, the freetag plugin is one of those that don't do it. I'm not sure, why. :)
# It should be possible to switch off this CSS compilation in general and only use the theme's CSS. Like this, useless overrides could be avoided.
Every plugin checks if "his" CSS attribute is used and cancels his output if it is, so you just need to make sure you add that CSS to your theme to disregard other output.
BTW, is there a place to report plugin-bugs?
Yes, exactly here. :)

Thanks,
Garvin

Posted: Tue Sep 04, 2007 12:10 pm
by drx
The plugin does not append its own CSS if you declare ".serendipity_freeTag' in your custom CSS somewhere.
Ahhhh! Does it only work if i use it exactly like you did here, or do constructions like

Code: Select all

#topWrapper div.header div.serendipity_freeTag {...}


do the trick as well? I am a bit lost on how all this works, is there some detailed documentation on it?

I will report bugs with the freetag plugin in a minute here.

Thanks and greets,
drx

Posted: Tue Sep 04, 2007 12:13 pm
by garvinhicking
Hi!

It simply matches on the Supstring ".serendipity_freeTag" that must be present in the style.css

HTH,
Garvin

FreeTag now plays along!

Posted: Tue Sep 04, 2007 8:34 pm
by drx
Great, so the freeTag plugin keeps its CSS to itself now!!

But still i have a problem: how can i load additional stylesheets or images via the CSS url attribute when the stylesheet is mangled through serendipity's stylesheet-combiner?

For example i want to use a background image:

Code: Select all

background: url(img/wxsat.gif) top left no-repeat;
This urls won't work coz the uri of my template directory is somewhere else than what s9y generates for the "virtual" stylesheet.

Thanks for your help,
drx

Re: FreeTag now plays along!

Posted: Tue Sep 04, 2007 8:45 pm
by garvinhicking
Hi!

In your style.css file you can use {TEMPLATE_PATH} which will later get substituted for your used template path.

HTH,
Garvin

Posted: Tue Sep 04, 2007 9:11 pm
by drx
Thanks!
Wouldn't it be easy to parse this from the CSS file and also include files referenced with

Code: Select all

@import url("another.css");
??

Posted: Tue Sep 04, 2007 9:58 pm
by garvinhicking
Hi!

Uhm...I don't understand what you mean?

Only in the style.css it can get replaced, because that gets parsed by s9y's serendipits.css.php file...

Regards,
Garvin