bottom margin in multi value field table display

Created on 3 August 2023, 11 months ago
Updated 10 January 2024, 5 months ago

Problem/Motivation

Gin introduces a bottom margin on form items in multi value field table display, by targetting class "field-multiple-table" from core's template_preprocess_field_multiple_value_form().
Claro sets the margin for a form item directly following the form-items-inline (date widget) class to a low margin (0.125em) on purpose (coming from container-inline.module.css).
This low margin from Claro is replaced with the larger margin from Gin in the multi value field table display. Imho the low margin should be used for the inline elements in multi value table display too.
The issue is caused by CSS specifity being more specific from the Gin "field-multiple-table" class selector, therefore overriding Claro style. I suppose this happened by accident.
Screenshot from FF inspector showing the CSS override:

Steps to reproduce

For an example you can use smart date module (multivalue field) and compare the widgets in Claro and Gin. With Gin the separator between dates is somewhat out of place.

Proposed resolution

Add the form-items-inline CSS to Gin field-multiple-table selector too

Remaining tasks

Create patch

User interface changes

🐛 Bug report
Status

Closed: outdated

Version

3.0

Component

Code

Created by

🇩🇪Germany stefan.korn Jossgrund

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @stefan.korn
  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • 🇮🇳India Preeti.chawla

    @stefan.korn I have applied the patch #2 and applied successfully. The separator alignment working fine in GIN. We are good to RTBC +1

  • Status changed to Needs work 11 months ago
  • 🇮🇳India djsagar

    Hi @stefan.korn,

    I have applied the patch #2 and applied successfully.

    Here is the steps:-

    1. Installed smart date module
    2. created field into Article content type

    After added field in Article content type i get this issue but this issue is not fixed after applied patch #2,

    please have a look Screen short

    let me know if there is something i forgot

    Thanks!

  • Assigned to stefan.korn
  • 🇩🇪Germany stefan.korn Jossgrund

    @djsagar: This is a single value field? Probably there is some other css selector combination causing the issue with single value field. Need to have a look at this.

  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • 🇩🇪Germany stefan.korn Jossgrund

    For a single value field this is not a Gin issue, as Claro is looking the same:

    And the separator label is not aligned really out of place, just more to the bottom as with multi value field. So one can maybe accept this discrepancy. But surely consistent look between single value and multi value would be preferable. But as this is not direclty Gin related, it probably should get fixed within the smart date module. Feel free to open an issue there or I will do if I find the time.

    For Gin I suppose this patch is complete and fixes the issue for multi value fields as described.

  • 🇮🇳India djsagar

    @stefan.korn: Thank you for sharing your feedback.
    Will check this.

  • First commit to issue fork.
  • @mandclu opened merge request.
  • 🇨🇦Canada mandclu

    I believe that part of the issue here is that Gin adds margin only to the bottom of the fields in this context. I created an MR that takes the same approach as the patch by @stefan.korn but also balances the top and bottom margins. In my testing this allowed the positioning of the separator to look the same as in Claro.

  • Status changed to RTBC 9 months ago
  • 🇮🇳India Shyam_Bhatt Gujarat

    @mandclu I have checked the "MR !294" working fine.

    After installing the smart date module, I created a field on the Basic content type page and the date range alignment works fine.
    Please check the below image for the same.

    Moving to + RTBC.

  • Status changed to Needs work 9 months ago
  • 🇨🇭Switzerland saschaeggi Zurich

    Moving this back to needs work as there are fixed values used and not Gin's CSS variables. E.g. --gin-spacing-xs

  • Status changed to Needs review 9 months ago
  • 🇮🇳India Shyam_Bhatt Gujarat

    I have updated the code with the gin variable for the multiple date range fields as per the suggestion.
    Please check the patch. I have attached the image after adding the patch.

    Update the code in the _table.scss file:

    tr .form-items-inline > .form-item {
        margin-top: var(--gin-spacing-l);
        margin-bottom: var(--gin-spacing-l);
      }
  • 🇨🇦Canada mandclu

    After updating to the latest release of Gin, the alignment of Smart Date items looked even more uneven. I wasn't sure how much these issues would apply to multi valued fields generally, versus being specific to Smart Date (I suspect more the latter). I opened this issue 🐛 Smart Date fields look wonky with latest Gin release Active against Smart Date to fix the alignment issues, which turned out to be a pretty simple fix.

    Anyone on this issue who is really looking to improve the display of Smart Date fields, please comment on that issue, and I should be able to spin a new release quickly.

  • Status changed to Postponed: needs info 7 months ago
  • 🇨🇭Switzerland saschaeggi Zurich

    @mandclu thanks for fixing this in smart date directly 👏

    Can we close this issue as this has been fixed in smart date itself? Or is there still anything open?

  • 🇨🇦Canada mandclu

    Based on my own experience I would say this is fixed, but it would be ideal if someone else in this thread could chime in to confirm.

  • Status changed to Closed: outdated 5 months ago
  • 🇨🇭Switzerland saschaeggi Zurich

    Closing

Production build 0.69.0 2024