Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. claro.theme

function claro_preprocess_select

Implements template_preprocess_HOOK() for select.

File

core/themes/claro/claro.theme, line 1014

Code

function claro_preprocess_select(&$variables) : void {
    if (!empty($variables['element']['#title_display']) && $variables['element']['#title_display'] === 'attribute' && !empty((string) $variables['element']['#title'])) {
        $variables['attributes']['title'] = (string) $variables['element']['#title'];
    }
    $variables['attributes']['class'][] = 'form-element';
    $variables['attributes']['class'][] = $variables['element']['#multiple'] ? 'form-element--type-select-multiple' : 'form-element--type-select';
    if (in_array('block-region-select', $variables['attributes']['class'])) {
        $variables['attributes']['class'][] = 'form-element--extrasmall';
    }
}
RSS feed
Powered by Drupal