diff -u b/core/includes/form.inc b/core/includes/form.inc --- b/core/includes/form.inc +++ b/core/includes/form.inc @@ -532,10 +532,12 @@ function template_preprocess_textarea(&$variables) { $element = $variables['element']; Element::setAttributes($element, array('id', 'name', 'rows', 'cols', 'placeholder')); + Element\RenderElement::setAttributes($element, array('form-textarea')); $variables['wrapper_attributes'] = new Attribute(); $variables['attributes'] = new Attribute($element['#attributes']); $variables['value'] = String::checkPlain($element['#value']); $variables['resizable'] = !empty($element['#resizable']) ? $element['#resizable'] : NULL; + $variables['required'] = !empty($element['#required']) ? $element['#required'] : NULL; } /** diff -u b/core/modules/system/templates/textarea.html.twig b/core/modules/system/templates/textarea.html.twig --- b/core/modules/system/templates/textarea.html.twig +++ b/core/modules/system/templates/textarea.html.twig @@ -7,6 +7,7 @@ * - wrapper_attributes: A list of HTML attributes for the wrapper element. * - attributes: A list of HTML attributes for the textarea element. * - resizable: Resizable setting value. + * - required: Required setting value. * - value: The textarea content. * * @see template_preprocess_textarea() @@ -18,6 +19,7 @@ set classes = [ 'form-textarea', resizable ? 'resize-' ~ resizable, + required ? 'required', ] %}