Page MenuHomePhabricator

FieldLayout: Remove need for extra `fieldLayout-header` element
Closed, DeclinedPublic

Description

We ouput span.fieldLayout-header as parent of every form widget label element currently.
Not only is this unnecessary in my opinion:

  • an additional DOM element quickly summing up for bigger forms (OOUI Special:Preferences features 202 of them),
  • no CSS/theming advantage due to label being a child and not a sibling element of the real form widget
  • naming convention is confusing (-body being parent to -header and -field), although we might not touch this in one task. I would go radically further and remove -body altogether as well, as we've got .oo-ui-fieldLayout as wrapper anyways. Neither currently in demos, nor in Special:Preferences, nor in any of the other code usages there seems to be any body specific rule that seems indispensable.
  • FieldsetLayout features -header on legend element, not on a parent span. So we would unify

It actually makes the styling and custom overrides unnecessary complex.

Things to be careful about in implementation:

  • Help PopupButtonWidget alignment and possible overrides/customizations in extensions
  • Breakages of current `.oo-ui-fieldLayout-header extensions

Event Timeline

Related issue is T178456, where DOM structure hinders simple solution accordingly.

(For reference, the relevant proposed change is https://gerrit.wikimedia.org/r/c/oojs/ui/+/335601, we've discussed this a bit there. To summarize, I am not sure if this is a good idea overall.)

Vvjjkkii renamed this task from FieldLayout: Remove need for extra `fieldLayout-header` element to habaaaaaaa.Jul 1 2018, 1:04 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from habaaaaaaa to FieldLayout: Remove need for extra `fieldLayout-header` element.Jul 2 2018, 2:56 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Going by the comments on the patch in Gerrit, isn't the actual state of this task "Declined"?