function olivero_preprocess_form_element
Implements hook_preprocess_form_element().
File
- 
              core/themes/ olivero/ olivero.theme, line 255 
Code
function olivero_preprocess_form_element(&$variables) {
  if (in_array($variables['element']['#type'] ?? FALSE, [
    'checkbox',
    'radio',
  ], TRUE)) {
    $variables['attributes']['class'][] = 'form-type-boolean';
  }
  if (!empty($variables['description']['attributes'])) {
    $variables['description']['attributes']->addClass('form-item__description');
  }
  if ($variables['disabled']) {
    $variables['label']['#attributes']['class'][] = 'is-disabled';
  }
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
