You are here

function claro_preprocess_menu_local_action in Drupal 9

Same name and namespace in other branches
  1. 8 core/themes/claro/claro.theme \claro_preprocess_menu_local_action()

Implements hook_preprocess_HOOK() for menu-local-action templates.

File

core/themes/claro/claro.theme, line 220
Functions to support theming in the Claro theme.

Code

function claro_preprocess_menu_local_action(array &$variables) {
  $variables['link']['#options']['attributes']['class'][] = 'button--primary';
  $variables['attributes']['class'][] = 'local-actions__item';
  $legacy_class_key = array_search('button-action', $variables['link']['#options']['attributes']['class']);
  if ($legacy_class_key !== FALSE) {
    $variables['link']['#options']['attributes']['class'][$legacy_class_key] = 'button--action';
  }
}