details.html.twig should include .description class

Created on 21 January 2014, about 11 years ago
Updated 21 February 2023, about 2 years 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

10.1

Component

Classy theme

Created by

🇳🇿New Zealand john pitcairn

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

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.71.5 2024