annotate core/themes/classy/templates/field/field--text.html.twig @ 5:12f9dff5fda9
tip
Update to Drupal core 8.7.1
author |
Chris Cannam |
date |
Thu, 09 May 2019 15:34:47 +0100 |
parents |
c75dbcec494b |
children |
|
rev |
line source |
Chris@0
|
1 {% extends "field.html.twig" %}
|
Chris@0
|
2 {#
|
Chris@0
|
3 /**
|
Chris@0
|
4 * @file
|
Chris@0
|
5 * Default theme implementation for a text field.
|
Chris@0
|
6 *
|
Chris@0
|
7 * A 'clearfix' class is added, because 'text' fields have a 'format' property
|
Chris@0
|
8 * that allows a Text Format to be associated with the entered text, which then
|
Chris@0
|
9 * applies filtering on output. A common use case is to align images to the left
|
Chris@0
|
10 * or right, and without this 'clearfix' class, such aligned images may be
|
Chris@0
|
11 * rendered outside of the 'text' field formatter's boundaries, and hence
|
Chris@0
|
12 * overlap with other fields. By setting the 'clearfix' class on all 'text'
|
Chris@0
|
13 * fields, we prevent that.
|
Chris@0
|
14 *
|
Chris@0
|
15 * @see https://www.drupal.org/node/2358529
|
Chris@0
|
16 *
|
Chris@0
|
17 * A 'text-formatted' class is added to assist with default styling of base
|
Chris@0
|
18 * elements such as paragraphs and lists that may not have classes assigned to
|
Chris@0
|
19 * them. This allows user entered content to have default styling without
|
Chris@0
|
20 * interfering with the styles of other UI components such as system generated
|
Chris@0
|
21 * lists or other dynamic content.
|
Chris@0
|
22 *
|
Chris@0
|
23 * @see https://www.drupal.org/node/2539860
|
Chris@0
|
24 *
|
Chris@0
|
25 * @ingroup themeable
|
Chris@0
|
26 */
|
Chris@0
|
27 #}
|
Chris@0
|
28 {% set attributes = attributes.addClass('clearfix', 'text-formatted') %}
|