Field labels have leading and trailing whitespace. When adding a collon using css, this leads to undesired results.

HTML before the patch

      <div class="field-label-inline">
      Date    </div>

HTML after the patch

<div class="field-label-inline">Date</div>

The attached patch includes all three DS field templates. I only tested the minimal template.
Twig docs on whitespace control: http://twig.sensiolabs.org/doc/templates.html#templates-whitespace-control

CommentFileSizeAuthor
ds-label-whitespace.patch1.45 KBSutharsan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sutharsan created an issue. See original summary.

aspilicious’s picture

Thanks for the patch!

aspilicious’s picture

Status: Needs review » Fixed

The expert field template needed some more love.
You learn something new every day... :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

newswatch’s picture

I don't think this has been resolved. I still get white space just before and after the output in every field-expert template.

I am using DS 8.x-3.13 on D 9.3.7 with PHP 7.4.28

newswatch’s picture

I must add this:

* This happens across my site.
* This is even when the Label is made "hidden".
* This only happens when the text input is plain text. It does not happen when the text input is Basic or Full HTML.