diff --git a/themes/seven/style.css b/themes/seven/style.css index c52d661..ac90ab2 100644 --- a/themes/seven/style.css +++ b/themes/seven/style.css @@ -575,11 +575,11 @@ html.js fieldset.collapsed { border-width: 1px; height: auto; } -fieldset fieldset { - background-color: #fff; +fieldset.fieldset-nested-odd { + background-color: #ffffff; } -fieldset fieldset fieldset { - background-color: #f8f8f8; +fieldset.fieldset-nested-even { + background-color: #f7f7f3; } /** diff --git a/themes/seven/template.php b/themes/seven/template.php index 5c086fa..48e9558 100644 --- a/themes/seven/template.php +++ b/themes/seven/template.php @@ -1,6 +1,11 @@ CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'weight' => 999, 'preprocess' => FALSE)); + drupal_add_css(path_to_theme() . '/ie.css', array( + 'group' => CSS_THEME, + 'browsers' => array( + 'IE' => 'lte IE 8', + '!IE' => FALSE), + 'weight' => 999, + 'preprocess' => FALSE) + ); // Add conditional CSS for IE7 and below. - drupal_add_css(path_to_theme() . '/ie7.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'weight' => 999, 'preprocess' => FALSE)); + drupal_add_css(path_to_theme() . '/ie7.css', array( + 'group' => CSS_THEME, + 'browsers' => array( + 'IE' => 'lte IE 7', + '!IE' => FALSE), + 'weight' => 999, + 'preprocess' => FALSE) + ); // Add conditional CSS for IE6. - drupal_add_css(path_to_theme() . '/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 6', '!IE' => FALSE), 'weight' => 999, 'preprocess' => FALSE)); + drupal_add_css(path_to_theme() . '/ie6.css', array( + 'group' => CSS_THEME, + 'browsers' => array( + 'IE' => 'lte IE 6', + '!IE' => FALSE), + 'weight' => 999, + 'preprocess' => FALSE) + ); } /** @@ -116,3 +142,34 @@ function seven_css_alter(&$css) { $css['misc/ui/jquery.ui.theme.css']['type'] = 'file'; } } + +/** + * Override of theme_fieldset(). + * + * Added odd/even classes for more fieldset theming options. + */ +function seven_fieldset($variables) { + $element = $variables['element']; + element_set_attributes($element, array('id')); + + $no_of_parents = count($element['#parents']) - 1; + $additional_class = ($no_of_parents % 2 == 0) ? 'fieldset-nested-even' : 'fieldset-nested-odd'; + _form_set_class($element, array('form-wrapper', $additional_class)); + + $output = ''; + if (!empty($element['#title'])) { + // Always wrap fieldset legends in a SPAN for CSS positioning. + $output .= '' . $element['#title'] . ''; + } + $output .= '
'; + if (!empty($element['#description'])) { + $output .= '
' . $element['#description'] . '
'; + } + $output .= $element['#children']; + if (isset($element['#value'])) { + $output .= $element['#value']; + } + $output .= '
'; + $output .= "\n"; + return $output; +}