Skip to content
Snippets Groups Projects
Commit 5a18bf9f authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #622330 by JohnAlbin, Jeff Burnz: CSS alternative to remove clearfix...

- Patch #622330 by JohnAlbin, Jeff Burnz: CSS alternative to remove clearfix from inline field markup.
parent e6cfb508
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -980,6 +980,11 @@ function template_preprocess_field(&$variables, $hook) { ...@@ -980,6 +980,11 @@ function template_preprocess_field(&$variables, $hook) {
'field-type-' . $variables['field_type_css'], 'field-type-' . $variables['field_type_css'],
'field-label-' . $element['#label_display'], 'field-label-' . $element['#label_display'],
); );
// Add a "clearfix" class to the wrapper since we float the label and the
// field items in field.css if the label is inline.
if ($element['#label_display'] == 'inline') {
$variables['classes_array'][] = 'clearfix';
}
// Add specific suggestions that can override the default implementation. // Add specific suggestions that can override the default implementation.
$variables['theme_hook_suggestions'] = array( $variables['theme_hook_suggestions'] = array(
...@@ -1090,7 +1095,7 @@ function theme_field($variables) { ...@@ -1090,7 +1095,7 @@ function theme_field($variables) {
$output .= '</div>'; $output .= '</div>';
// Render the top-level DIV. // Render the top-level DIV.
$output = '<div class="' . $variables['classes'] . ' clearfix"' . $variables['attributes'] . '>' . $output . '</div>'; $output = '<div class="' . $variables['classes'] . '"' . $variables['attributes'] . '>' . $output . '</div>';
return $output; return $output;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment