[pmwiki-users] problem with @import css rules when going through php

Bronwyn Boltwood arndis at gmail.com
Fri Aug 5 16:40:15 CDT 2005


I have a weird problem on my hands and I will understand perfectly if
nobody has any ideas for solving it.  That said, I sure hope you folks
will have some ideas! :)

While rewriting the css files for my Pukka skin, I discovered that
@import rules in css files don't work when the css file gets included
by the stitch.php file.  The stitch file looks something like this:

	<?php
		header('Content-type: text/css');
		#include("css/layout-abpos-sb15em.css");
		#include("css/layout-abpos-sb22em.css");
		include("css/layout-abpos-sb28pct.css");
		#include("css/layout-abpos-sb33pct.css");
		include("css/layout-abpos-leftsb.css");
		#include("css/layout-abpos-rightsb.css");
	?>

Stitch.php's jobs are to 
	(1) configure the skin, by commenting out unwanted options,
	(2) reduce the page loading time and server load, because there are
far fewer file requests this way,
	(3) provide a mechanism to save skin configurations.  
I need those jobs done, so I can't just go back to putting all the
individual entries in <head>.

I have triplechecked the @import syntax and the relative paths, and
then tested by putting one file with some @import rules directly into
<head>.  That worked, so I know the problem is in the php layer.  I
just have no clue how to fix it.

The Firefox web developer extension's edit css feature shows that the
files with @import rules are being read, but it seems that the @import
rules themselves aren't acted upon.

I don't have to keep the basic format of stitch.php so long as the
solution can perform the same jobs.  An additional constraint is that
there are two stitch_foo.php files, because one batch of css should be
linked to the template, and the other batch needs to be @imported, to
filter out browsers that can't handle the css included.

It's not critical that this problem be solved, but it would be really
helpful, since eventually I will have no sane alternative but to use a
css file with @import rules.

Bronwyn




More information about the pmwiki-users mailing list