1 {% extends "field.html.twig" %}
5 * Default theme implementation for a text field.
7 * A 'clearfix' class is added, because 'text' fields have a 'format' property
8 * that allows a Text Format to be associated with the entered text, which then
9 * applies filtering on output. A common use case is to align images to the left
10 * or right, and without this 'clearfix' class, such aligned images may be
11 * rendered outside of the 'text' field formatter's boundaries, and hence
12 * overlap with other fields. By setting the 'clearfix' class on all 'text'
13 * fields, we prevent that.
15 * @see https://www.drupal.org/node/2358529
17 * A 'text-formatted' class is added to assist with default styling of base
18 * elements such as paragraphs and lists that may not have classes assigned to
19 * them. This allows user entered content to have default styling without
20 * interfering with the styles of other UI components such as system generated
21 * lists or other dynamic content.
23 * @see https://www.drupal.org/node/2539860
28 {% set attributes = attributes.addClass('clearfix', 'text-formatted') %}