Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
krueschi CreditAttribution: krueschi commentedSome 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.
Comment #2
JohnAlbinThe 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...
Comment #4
krueschi CreditAttribution: krueschi commentedThanks for this information!