In Zen 7.x-3.x-dev (2011-02-25) the section in fields.css reads:

.field-field-FIELDNAME /* Underscores in field name are replaced with dashes. */ {
}

Trying a lot of styling with custom created fields which didn't work I looked for a solution in other themes and the Drupal 7 core module css's.

I've figured out, that the field-name should be field-name-FIELDNAME instead of field-field-FIELDNAME, but I'm not sure if this is correct for future development of Zen for Drupal 7.

Here is what I found out working:

.field-name-FIELDNAME  { /*Underscores in field name are replaced with dashes.*/
}

So please have a look at this.

Thanks!

Comments

krueschi’s picture

Some addition:

Further testing of this issue revealed, that it does not work for an image-field (drupal 7 core), so only a text-field uses the new defined css-styles.

JohnAlbin’s picture

Title: field.css in STARTERKIT has wrong comment / documentation for styling custom created fields » Update fields.css to use new classes for fields in core
Component: layout.css » CSS/HTML markup
Status: Active » Fixed

The fields.css hadn't been updated since the Drupal 6 version. So all those comments were referring to D6 and not to the new fields in core of D7.

Named fields match this pattern in D7: .field-name-field-FIELDNAME

I just went through all the field types in D7 core and the Date and References contrib modules and updated the fields.css file. http://drupalcode.org/project/zen.git/commit/7c0bfcec26ed6d7b71ced6bba48...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

krueschi’s picture

Thanks for this information!