function claro_preprocess_datetime_wrapper in Drupal 10
Same name and namespace in other branches
- 8 core/themes/claro/claro.theme \claro_preprocess_datetime_wrapper()
- 9 core/themes/claro/claro.theme \claro_preprocess_datetime_wrapper()
Implements template_preprocess_HOOK() for datetime_wrapper.
File
- core/
themes/ claro/ claro.theme, line 867 - 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');
}
}
}