Cascading CSS and conditional CSS

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
User avatar
RobA
Regular
Posts: 317
Joined: Wed Apr 27, 2005 5:11 pm
Contact:

Cascading CSS and conditional CSS

Post by RobA » Mon Feb 06, 2006 8:48 pm

Couple of things -

#1) Looking at the way s9y loads its stylesheet means that you have to call it style.css and it gets loaded, even though the browser thinks it is loading serendipty.css

Because of this, is there a way to include other style sheets using the:

Code: Select all

@import url(layout.css);


function in my style.css? or does everything have to go in the one style.css file?

#2) I wanted to use a condition include in my index.tpl like so:

Code: Select all

    <!--[if IE]><link rel="stylesheet" type="text/css" href="./ie.css" /><![endif]-->


to add another css to handle IE quirks....but this (of course) won't find the file ie.css in my theme directory for the same reasons.

Any suggestions on how to have this optional css definition?

Thanks,

-Rob A>
* My s9y blog:
* Rob A's (Im)Personal Blog
* http://www.silent9.com/blog

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Cascading CSS and conditional CSS

Post by garvinhicking » Tue Feb 07, 2006 10:55 am

Hi!

It should be perfectly fine ti do @import within your style.css file! Remember though, that the import directory scope is within "/", so if you put your "import.css" file in your template directory, you'll need to @import url(templates/yourtheme/import.css).

This actually applies to your second problem. Use the right path. :-)

Regard,s
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
RobA
Regular
Posts: 317
Joined: Wed Apr 27, 2005 5:11 pm
Contact:

Post by RobA » Tue Feb 07, 2006 7:38 pm

I tried using the smarty templating:

@import url({TEMPLATE_PATH}layout.css);

which didn't perform the import (though it does work for assigning background images)...

Could there be something in the serendipity.css.php code that doesn't allow this?

Or it could be that I am installed at /blog/ rathern than / of the docroot?

-Rob A>
* My s9y blog:
* Rob A's (Im)Personal Blog
* http://www.silent9.com/blog

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Tue Feb 07, 2006 8:51 pm

No, the serendipity.css.php is not responsible. You should have a look at your generated CSS code by calling the CSS via browser and then see which URL is there.

Or you give us the URL where you tried to insert this, so we can see it.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Post Reply