Drupal has relocated the css files which are applied to my website to "sites/default/files/css" and named them using a string of about 20 random letters/numbers (i've used firebug to see the location of css files being referenced and applied)...

ive tried deleting these files, but drupal automatically creates "sites/default/files/css" directory again. drupal used to apply the css files with their proper names from the themes folder, but this is no longer the case. what is going on and how do i fix this?

Comments

WorldFallz’s picture

If you're using a theme that allows color changes via the UI and you change the colors, this is where that info is stored. This is correct behavior-- there's nothing to fix. If you don't want this to happen, then don't change the colors with the color changer ui.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

djpenta88’s picture

what does UI stand for? user interface?

WorldFallz’s picture

sorry-- yes, UI = user interface.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

stackpool’s picture

Make sure you didn't turn on the option to optimize your CSS in admin/settings/performance — this should be done only when you're completely happy with your page and have no more CSS modifications to make. It's easy to forget about if you come back to the site after a while.

jordotech’s picture

Aren't there contributed modules that also create this directory?

viralagrawal’s picture

thank you! u solved my problem

truyenle’s picture

If you didn't turn this on, then the site displayed in IE so weird especially admin page. Edit a view, you'll see this.

Truyenle

RKS’s picture

This is because IE only allows 31 CSS files per page. So with all the contrib modules, site, etc, you have more than 31. This is what CSS optimization is for as well as speed up performance when a site needs to call that many CSS files when loading a page.

smuthukris’s picture

Thanks a lot stackpool.

candelas’s picture

i was going crazy with my styles and seen this css extranges!!! O.O

//trying to answer one question for each one that i make.
//this way, drupal will be more friendly and strong

MohammedGhazo’s picture

This is what i'm looking for, Thank u

doktorrr’s picture

I didn't use color change UI on my sky theme and yet I have css files in directory files/css. I hope if I turn off optimized css in site performance that css files be in theme/sky/ directory.

doktorrr’s picture

No.If I turn off css optimization,drupal back css files in themes/sky foleder,but when I make some change on css file and turn on css optimization,drupal back old css files in file/css directory again. It din't bother me,but it meand that I can't make any changes if I want to have turn on css optimization.

dziemecki’s picture

Keep CSS caching - it makes sense. Just clear your cache after you modify CSS.

RKS’s picture

If you don't turn off css optimization when making your changes it will save your new css in the Drupal created files. It doesn't prevent you from making changes, it just collects it all in one place for a few different reasons. I have no idea why turning it off is affecting the css but apparently when you turn it back on it doesn't update. Solution = don't turn off when you make changes.