details.html.twig should include .description class

Created on 21 January 2014, over 10 years ago
Updated 5 July 2023, 12 months ago

See the patch at #2152207: Convert theme_details() to Twig → .

Details should include a div.description to allow themes to target form help text consistently. From the patch:

+    <div class="details-wrapper">
+      {%- if description -%}
+        <div class="details-description">{{ description }}</div>
+      {%- endif -%}
+      {%- if children -%}
+        {{ children }}
+      {%- endif -%}
+      {%- if value -%}
+        {{ value }}
+      {%- endif -%}
+    </div>
+  </details>

div.details-description does not receive the same text formatting as div.description, which makes form help text look inconsistent, and requires extra work for themes to override.

And if there is a div.details-wrapper I'd expect to find a div.details inside that, or else the wrapper should be div.details-description-wrapper, no?

I think ideally this should be changed to:

<div class="details description">

There are currently only two lines in core css targeting .details-description (in user.module.css and bartik style.css). Text formatting for those is inconsistent with other help text anyway, these would need to change to target .details.description, or perhaps just be removed.

Objections? Comments? I can supply a patch when the twig conversion is committed.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇳🇿New Zealand John Pitcairn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024