Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299618

Margin on form-items in table rows (Seven)

$
0
0

In #2675464: Margin on form-items in table rows (Classy) we identified and devised a solution for a problem in the Classy theme that causes problems for modules like IEF and Paragraphs. However, @lauriii suggested it was too dangerous to fix properly in Classy without trying first in Seven.

Problem

In /core/themes/classy/css/components/form.css we have:

tr.odd .form-item,
tr.even .form-item {
  margin-top: 0;
  margin-bottom: 0;
}

This works fine for single element forms (like checkboxes or selects) in table rows, but causes problems when we want to have more complex multi-element forms in tables (like anywhere in a standard node edit form when a field widget requires multiple form elements).

Furthermore, this seems to break content list styles.

Solution

Replace the above code with:

* When a table row has a single form item, prevent it from adding unnecessary
* extra spacing. If it has multiple form items, allow spacing between them
td > .form-item:only-child {
  margin-top: 0;
  margin-bottom: 0;
}

Todo

  1. Create a patch
  2. Post screenshots showing before/after in a complex form like paragraphs
  3. Post screenshots showing before/after in the content list
  4. Tag for Needs frontend framework manager review
  5. Copy issue credit across from #2675464: Margin on form-items in table rows (Classy)


Viewing all articles
Browse latest Browse all 299618

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>