tags:

views:

24

answers:

2

I'm a Drupal newbie plus I don't have much experience updating code, styles, and scripts in an open-source project. I've inherited a site running Drupal 5.16.

In Drupal, I have created a page that is not published. The main content node has a node-unpublished class which is defined in /modules/node/node.css. This class has styling that makes viewing the unpublished page unreasonably hard do to the theme of the site. I believe that the node.css file should not be touched since it is part of the Drupal core.

What is the proper way to over-ride the style a css class within the Drupal core?

I assume it would be to over-ride it in the theme's css, but I want to double check that I'm conforming to open-source conventions.

Thanks.

A: 

Any rule that is specified after that rule (and that conflicts with it), will override it.

If you cant to leave the core files untouched, you can create a "Customizations.css" file, and just write your own rules from there.

Note that it will only override the attributes you explicitly assign new values. So unless a given attribute is overridden, it'll keep that attribute from the prior rule.

.node-unpublished { color: red; background-color: black; }
.node-unpublished { color: black; }

The result of the above will be black text upon black background...

David Hedlund
+1  A: 

Overriding in the theme's CSS is a common approach. Another option is Stylestripper, which lets you disable whole core stylesheets.

Scott Reynen