There is unnecessary duplication of CSS classes added to field items when there is no label and there are multiple items. See screenshots.

This is a bug, and not just philosophical, because if you use any proportional declarations, like setting width in percentage, it gets applied twice. Also, given or CSS naming standards, most of these classes shouldn't be repeated within the same hierarchical path.

Before

After

Comments

davidhernandez created an issue. See original summary.

davidhernandez’s picture

Issue summary: View changes
davidhernandez’s picture

Status: Active » Needs review

Forgot to set status so the patch gets tested.

mdrummond’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
29.27 KB

This looks really good to me. I tried to look back at #2214241: Field default markup - removing the divitis to see where this was introduced, but it looks like it was pretty far back. This makes much more sense. We shouldn't be using the classes variable on both attributes and item.attributes, which is what was happening.

Very good catch.

Tested this and verified it fixes the problem.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 54b6085 and pushed to 8.0.x. Thanks!

  • alexpott committed 54b6085 on 8.0.x
    Issue #2560411 by davidhernandez: The same CSS classes are being added...

Status: Fixed » Closed (fixed)

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