the truth, the whole truth, the knock you on your butt truth...

Monday, February 05, 2007

new drupal css

I just thought I would share a quick tip for those of you who enjoy recoding your Drupal layouts via the CSS files. I was recently playing around with the new color switching "Garland" theme, ad after I found a color combination that I liked, I went to further customize the layout. Unfortunately, it was driving me insane as many of the changes I was trying to make just weren't taking effect. I don't know about you, but there's nothing worse than spending an hour trying to figure out why a transparent background image isn't showing up, only to find out that you've been messing with the wrong CSS file.

So here's a clue, from me to you. When using the custom color switching tool in Drupal 5, for a theme like Garland, it automatically creates a new CSS file and images in the root>files>color folder, meaning that the default Garland folder no longer sets the style for the page. Instead of running off to now alter the style.css file in the new custom color directory, create your own overriding CSS file and upload it into the theme s>garland folder instead. Why? Because any time that you go to change the theme via the admin interface (even if you're just changing the logo or motto, etc), it will take the default style.CSS file from the themes folder and use it to write the new custom color theme, thereby overwriting any custom changes you may have done.

In my case, I simply created a new file - override.css - or whatever you want to call it, and placed it in the theme. Now I can change the colors via the admin interface and my custom CSS rules will still override the new custom color folder.

Labels: ,

0 Comments:

Post a Comment

<< Home