How to add dynamic created css using drupal_add_css I am trying to add a file which is located in sites/default/files/color/theme-768/color.css using drupal_add_css().

I have tried drupal_add_css($filepath), but it doesn't work. I tried putting it in template.php and hook_init(), but still it isn't included in the style tags of head section or anywhere.

How I do include a CSS file like this using drupal_add_css()?
I found a alternate way to include css file which is in some other location other than modules and themes.In my case including a dynamically generated file.
Even though i can't find a way through drupal_add_css(),this helped me in adding css.

This is the way i included dynamically generated css file which is located at sites/default/files/color/theme-768/color.css

In the theme folder in the html.tpl.php  after &lt;?php print $styles;?&gt; include this

&lt;?php    
       print '&lt;style&gt;';
       print '@import url("' . $filepath . '")';
       print '&lt;/style&gt;';
?&gt;


This includes the css file.