@import in style.css
Posted: Tue Jan 06, 2009 12:50 pm
As far as I remember, this isn't new, but I just stumbled across it again.
There are different ways to include stylesheets in a template. One way is @import. One could, for instance, have a master.css with the following content:
etc., you get the picture. The benefit of this is a modularized stylesheet system. Anyway, if one uses this syntax in a template's style.css, it doesn't work. Doesn't even matter how one references the stylesheet to be included in the url( ) statement - it simply doesn't work in style.css, period.
However, if one actually uses a master.css or anything else != style.css, it works just fine. As we all know, style.css is "converted" in a s9y environment - the file which is actually included eventually is serendipity.css, which is style.css plus some plugin styles.
I'm guessing @import doesn't work here because PHP/Smarty get in the way during this conversion, correct? Since @ is used for some purposes in PHP/Smarty? Now, is there any way to "mask" @import and make it work in style.css? Or do we simply have to use a different stylesheet than style.css if we want to use @ in CSS?
YL
There are different ways to include stylesheets in a template. One way is @import. One could, for instance, have a master.css with the following content:
Code: Select all
@import url(css/reset.css);
@import url(css/typo.css);
@import url(css/colors.css);
However, if one actually uses a master.css or anything else != style.css, it works just fine. As we all know, style.css is "converted" in a s9y environment - the file which is actually included eventually is serendipity.css, which is style.css plus some plugin styles.
I'm guessing @import doesn't work here because PHP/Smarty get in the way during this conversion, correct? Since @ is used for some purposes in PHP/Smarty? Now, is there any way to "mask" @import and make it work in style.css? Or do we simply have to use a different stylesheet than style.css if we want to use @ in CSS?
YL