Can I change the order that the stylesheets are loaded? I need to change the way some styles are cascading. In other words, the event module stylesheet loads first and some of it's values are overid by the next stylesheets. I need the event module stylesheet to load last.

Any ideas?

Thanks!

Comments

dman’s picture

The C in CSS stands for cascading.
If you can understand the rules of the cascade, you should be able to fix this the right way.
Your theme has the ability to over-ride all module built-in CSS, and that's where you want to add your adjustments.

Basically, just be more specific in the CSS selection rules for the styles you really care about.
Using #ids instead of .classes usually trumps any other setting.

There is a zen to choosing the minimal, semantic, contextual sort of selectors in CSS. In a way that makes sense. It takes some practice.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

geoffb’s picture

A similar problem to Setfree's that I am encountering is that some styles that I am trying to override are in a css file (from the Panels module) that loads after my general styles.css file. The only way to change the style is to go back to the css file in the Panels module. Not good practice.

styles.css should load last.

Anyone got any ideas on how to change the order?

mlncn’s picture

Panels is special-- you can copy the files you're interested in (or make new ones with the same name) to site's theme directory (keeping the same directory path, layouts/panel-3-col.css or whatever) and it will override the stylesheet in panels.

I think all of Drupal finally works like this in Drupal 6.

~ben

People Who Give a Damn :: http://pwgd.org/ :: Building the infrastructure of a network for everyone
Agaric Design Collective :: http://AgaricDesign.com/ :: Open Source Web Development

benjamin, Agaric