0

I want to add new css file. I added the following line in my .info file:

stylesheets[all][] = css/layout.css
stylesheets[all][] = css/style.css
stylesheets[all][] = css/colors.css
stylesheets[all][] = css/imagehover.css
stylesheets[print][] = css/print.css

I flush all cache. just to be sure I inspect page source but I only see style.css has been included:

<link rel="stylesheet" `href="http://sinepulse.local/sites/all/themes/smart_sinepulse/css/style.css">` 

What about the others css files. Whats wrong with my approach?

4
  • Are you importing these css files in your own custom drupal 7 theme? Commented Feb 25, 2018 at 12:22
  • Yes. I am importing these css files in your own custom drupal 7 theme Commented Feb 25, 2018 at 12:23
  • It might be possible that caching mode in your drupal website might be disabled. Check this specific SO post : stackoverflow.com/questions/2610837/… on for more details Commented Feb 25, 2018 at 12:27
  • Do you have a html.tpl.php in your theme? If so, what does it look like? Commented Feb 26, 2018 at 21:15

1 Answer 1

1

If this way not working then try another way to add CSS follow the code to your template.php file

function MYTHEMENAME_preprocess_html(&$variables){
  $theme_path = base_path() . path_to_theme();
  drupal_add_css($theme_path.'/assets/css/style.css');
}

If after that not import your CSS then the problem is catching.

Thank You.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.