I ran into an interesting issue today whereas my theme would be missing CSS statements when the "Optimize CSS files" was turned on in /admin/settings/performance. I believe it may be due to a bug.

I have the views module enabled, which has a file called sites/all/modules/views/css/views.css included. In my theme, I had also created a file called views.css which was included in the theme's .info file at sites/all/themes/mytheme/views.css. When enabling the "Optimize CSS files" option, Drupal was picking up my views.css file from the theme but was ignoring the module's views.css file. This resulted in broken css since I always assume the module's css file would be there.

My workaround was easy - change my theme's views.css file to myviews.css. After I did that everything now works normally and both the module and theme CSS files load properly.

This is easy to reproduce - add views.css or someothercssfile.css in your theme with the same name as a module's css file. It should load up your theme's file but not the module file.

Comments

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.