You are here

function claro_preprocess_datetime_wrapper in Drupal 8

Same name and namespace in other branches
  1. 9 core/themes/claro/claro.theme \claro_preprocess_datetime_wrapper()
  2. 10 core/themes/claro/claro.theme \claro_preprocess_datetime_wrapper()

Implements template_preprocess_HOOK() for datetime_wrapper.

File

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

Code

function claro_preprocess_datetime_wrapper(&$variables) {
  if (!empty($variables['element']['#errors'])) {
    $variables['title_attributes']['class'][] = 'has-error';
  }
  if (!empty($variables['element']['#disabled'])) {
    $variables['title_attributes']['class'][] = 'is-disabled';
    if (!empty($variables['description_attributes'])) {
      $variables['description_attributes']
        ->addClass('is-disabled');
    }
  }
}