Problem/Motivation

When description_display is set to 'after' or 'invisible' it uses a small element, so the default margin-top on .form-text does not apply.

{% if description_display in ['after', 'invisible'] and description.content %}
    <small{{description.attributes.addClass(description_classes)}}>
      {{ description.content }}
    </small>
{% endif %}


https://git.drupalcode.org/project/radix/-/blob/6.0.x/components/form-element/form-element.twig?ref_type=heads#L114

Steps to reproduce

Proposed resolution

I suggest not using the small element at all. It doesn't affect the font size, which is controlled by the form-text class.

Perhaps "small" was used for layout purposes, especially since it's an inline element. In that case, we should set d-inline-box to make the margin-top work.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork radix-3606444

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

thomas.frobieter created an issue. See original summary.

thomas.frobieter’s picture

Status: Active » Needs review
doxigo’s picture

Status: Needs review » Fixed

Thanks Thomas, I haven't tested this myself but I'll take your word for it, merged.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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