I would like to make some changes to the core toolbar module across all my sites, and I don't want to modify the actual core's css. It looks like I should be able to override the core css found in modules/toolbar/toolbar.css by simply copying this file into my sites directory at /sites/modules/toolbar/toolbar.css. I tried doing this, cleared the Drupal cache, but nothing happened. What am I missing?
Ben Your solution is not ideal, as you now have your own version of the toolbar module, and should there be any bug fixes and security fixes, you will not benefit from those, without upgrading your version of the toolbar module.
CSS will by it's design overwrite itself, since the theme CSS files will be included last, any rule you make in your theme that is identical to what's in the toolbar will take presedence.
Sometimes it can be a pain to revert styles to browser default, if that is the case, creating a css file with the same name as the one you want to remove and including it in your theme, will make Drupal skip the one in the module and use the one in your theme. In this case creating a
toolbar.css file anywhere in your theme and adding it in your info file, will remove the
toolbar.css file from the toolbar module and fix your problems.
Remember to clear cache
If by some reason you have problems making solution 2 work, you can instead remove the css file using
hook_css_alter, this only works in Drupal 7+
I am running multiple sites on a single Drupal install, so I need a way to have a single style sheet file I can edit that will be applied to all sites in all themes.
There's two solutions for the multi-site situation you describe:
1) Create a custom module that implements hook_css_alter() to replace core css files with your own css file overrides. Enable this module on all of your sites.
2) Create a "base theme" that essentially does the same thing, but uses the *.info file to override the css files from core. (Technically speaking you could also use hook_css_alter in the theme instead too). All of your sites' respective themes should specify this parent theme as their base theme in their respective info files and those overridden css files from the base theme will be inherited.
There is no need to override the whole file to make changes. You can replace any of the core css settings by entering the specific items into a custom css in your theme folder. It will override the individual settings for that theme. Make certain that the file is identified as a stylesheet in the info file for the theme .
No need to change the core .php files you should: 1. write the css in your style.css/ example.css file 2. add !important after the property you want to override. for example you want to override font size which is 12px so:font-size:14px !important;
You can simply redefine all the id's and classes's of the CSS in your themes styles.css that you wanna override and remember after defining id's and classes's importantly mention all the property again with your desired value, it won't work only when its defined as '!important' for an instance 'display: block !important;'
Hope this might help you, if any assistance needed in that just drop your comment :)
I did this: http://drupal.org/node/176046
Basically copied the core toolbar directory into the /sites/all/modules directory. Then made the changes I needed. For some reason I had to try this a few times before it actually worked. I don't know if it was due to errors on my part or some extreme server caching.