Problem/Motivation

Drupal core's admin theme Claro styles field-item to have margin-block: var(--space-l); which is very important for the spacing of forms.

In general i think form-item is expected on items in a form for consistent styling.

Adding the class with a template override is not convenient because it is on the suggestion-less container template (although it is possible Twig Template Suggester could help with that).

Proposed resolution

Add this class, possibly with an option to add it or not.

Remaining tasks

User interface changes

API changes

Data model changes

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

mlncn created an issue. See original summary.

mlncn’s picture

Status: Active » Needs review

Seems the best solution, despite adding one more nested div, is to add the form-element template as a wrapper, which should let all themes treat form items as they thing they should be treated.

Happy to add a configuration option for this, disabled by default, if at most we want an optional change that does not impact existing sites at all.

  • astonvictor committed 35a212b0 on 2.x authored by mlncn
    [#3542041] feat: Add `form-item` class to the edit-FIELDNAME-wrapper...

  • astonvictor committed 497ed50c on 2.1.x
    [#3542041] feat: Add `form-item` class to the edit-FIELDNAME-wrapper...
astonvictor’s picture

Status: Needs review » Fixed

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.