I had a similar problem , and :
In my php file i add :
PHP Code:
$myvbcsspath = 'css.php?styleid=' . $style['styleid'] . '&langid=' . LANGUAGEID . '&d=' . $style['dateline'] . '&td=' . $vbulletin->stylevars['textdirection']['string'] . '&sheet=';
PHP Code:
$templater->register('myvbcsspath', $myvbcsspath);
And in my template :
HTML Code:
<link rel="stylesheet" type="text/css" href="{vb:raw myvbcsspath}mytemplate.css" />
*Rebuild style information .
Now it's work .
Look includes/class_core.php , Line 3994