I am trying to incorporate color scheme which is available in bartik, into my theme. I am able to generate the files which will be located at


after making options in color scheme of my theme.

But in the head tag of styles files, it still points to my theme directory colors.css instead of above mentioned directory, Which results in no change of colors for my theme.

My theme is actually a sub theme. What am i doing wrong ??

  • I have included color folder and inside that have color.inc files.
  • Also included color.css folder inside css folder.
  • hook_process_page(&$variables) and hook_process_html(&$variables) these functions included in template.php
  • included css file in info file too. stylesheets[all][] = 'css/colors.css'

What am I missing in not getting that css being replaced by dynamically generate one? Thanks in advance.

  • Are you saying in subtheme, its not working but working in main theme??
    – pown
    Jul 25, 2013 at 10:19
  • i am using nucleus as base theme and based on that i have sub themed.I am just trying to get color scheme options for my sub theme.
    – Ram
    Jul 25, 2013 at 10:22
  • If I may ask, what is it you want exactly? You can do everything using css. then again I'm asking why would you want to generate it dynamically??
    – pown
    Jul 25, 2013 at 10:26
  • I am trying to keep user an option of changing header,footer etc in the theme section using color scheme. The problem i am facing is that i am able to generate files for css for given color scheme in the ui, but in head tag of styles it is still pointing to themes/color.css instead of dynamically generated color.css which will be located at default/files/color/theme-999.css.
    – Ram
    Jul 25, 2013 at 10:31

1 Answer 1


I am able to apply css for my header and other things, I found an alternative way to include the css.Even though I can't find a way through drupal_add_css(), the following 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 <?php print $styles;?> include this

       print '<style>';
       print '@import url("' . $filepath . '")';
       print '</style>';

This includes the css file and provided colors for header, footer etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.