I'd like to stop all modules from inserting CSS, as well as any core CSS insertion. I know I can override CSS files, but instead I'd like to be able to actually STOP all css files from being inserted. Is this possible?

Comments

brst t’s picture

Just noticed this through the rss feed and have a quick answer for you to try.

http://drupal.org/project/stylestripper

ikeizer’s picture

Interesting will try it out!

gausarts’s picture

Yes, remove print $styles from page.tpl. It will remove every css files :)

On second thought, no, ignore that, you'd better go to your .info file. An explanation from zen_classic theme:

; To prevent stylesheets of a base theme or of a module from being included in
; our sub-theme, we specify it in our .info file (and we don't need to have a
; stylesheet in our sub-theme with that name.) For example, we prevent the
; zen.css file in the base theme from being included by specifying it here.

Duplicate any call to modules css there to remove them. Here is an example if you want to remove node.css:

stylesheets[all][] = node.css

This will remove node.css from inclusion. Add as many as unnecessary css files you want to remove. If they are placed inside a subdirectory of the module, include the subdirectory as well.

Please bear in mind, there are some important css to drupal, you must exclude them from removal, such as: defaults.css, system.css, color.css, farbtastic.css, or else copy over into your custom aggregated css file. Just be careful. Once you edit your .info file, you must clear the theme registry.

On the third thought, actually if all you worry about is http requests. Drupal has built-in aggregator for javascript and css. So you must visit admin/settings/performance to activate it.

love, light n laughter

ikeizer’s picture

Thanks Gausarts, I think I will actually go with just removing $styles, as otherwise I'll have to override every single CSS file. It's not the requests I'm worried about, its just ease of CSS editing as I prefer all style info to be in one single CSS instead of X different ones.