Problem/Motivation
The button with css class .field-add-more-submit has no vertical margin.
when a lot of this buttons are used inline. A second row wil be used. Without vertical margins the buttons stick to each other.
Steps to reproduce
This can be seen when using the buttons function in the Paragraphs form.
1. Install paragraph module
2. Create multiple paragraph types
3. Create a content type and add paragraph as reference field with 'Add mode' as buttons
4. Save the changes
5. Goto create content and check 'Add paragraphs' buttons have vertical margin
6. Verify this for various themes
Proposed resolution
Add 5px top and bottom margin
Remaining tasks
create a patch, test it, commit it.
Wrong behaviour:

Wanted:

| Comment | File | Size | Author |
|---|---|---|---|
| #42 | afterpatch_stark.png | 140.59 KB | dishakatariya |
| #42 | afterpatch_olivero.png | 245.64 KB | dishakatariya |
| #42 | afterpatch_claro.png | 138.01 KB | dishakatariya |
| #42 | before-patch.png | 137.64 KB | dishakatariya |
| #34 | after_patch.png | 80.61 KB | bhumikavarshney |
Issue fork drupal-3198236
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:
- 3198236-add-another-buttons
changes, plain diff MR !5907
Comments
Comment #2
johan den hollander commentedComment #3
mstrelan commentedAttached patch adds a margin of 0.5rem to the top and bottom of these buttons. This is computed from the
--space-xsvariable which equates to 8px.Comment #4
johan den hollander commentedThanks @mstrelan. This makes it look a lot better.
However I feel the vertical margin could be a bit smaller.
Why not make it the same as the horizontal margin between the buttons?
Comment #5
mstrelan commented@johandenhollander I simply chose the smallest defined variable for margins already available.
The buttons have no left margin but have a right margin of 12px (0.75rem). Adding the 8px (0.5rem) to the top and bottom margin makes a 16px gap. I've attached another patch that reduces the new vertical margin to match the horizontal margin.
FWIW the fact this was previously set to 0 margin suggests there may have been a reason for it.
Comment #6
johan den hollander commentedOk. It looks good now. Could you see if there was a related issue?
I pressume no vertical margin was needed because it was not expected that so many buttons were ever used that it needed a second row of buttons.
Comment #7
mstrelan commentedThe 0 margin seems to have been introduced here: https://www.drupal.org/project/claro/issues/3023326#comment-13244734
Comment #8
johan den hollander commentedAs far as I can judge the added margin will not cause any disturbances then.
Let's see if we can have more people review this.
Comment #9
vikashsoni commentedThis issue is not exists and fixed
Comment #10
poorva commentedRTBC +1
Comment #11
radheymkumar commentedThere are proper alignment and proper padding available
Comment #12
Madhu kumar commentedCould not find any issue proper vertical margins are available for button
Comment #14
kristen polFrom #9, #11, and #12, it doesn't seem like this is reproducible.
@Johan den Hollander Would you check this is still an issue? And, if so, for what version.
For those testing, it's useful to know what Drupal version you tested with.
Comment #15
johan den hollander commented@Kristen Pol I just tested this again.
Drupal core 9.3.6 / paragraphs 8.x-1.12 (also tested with dev)
Seven theme: Ok.
Claro theme: Not ok.
Gin theme: Ok, see https://www.drupal.org/project/gin/issues/3218033
See attached screenshots.
Comment #16
kristen polThank you for reproducing the issue again @johandenhollander. Reopening this.
1. Patch is straight forward though not sure it is the approach the Claro team would approve.
2. Changing issue to version 9.4. The patch applies cleanly to 9.3 and 9.4 and with offsets for 10:
3. Tagging for testing for 9.4. The steps to reproduce could be more clear but, for those who know how to use paragraphs, they should be able to reproduce. It would be good to add more explicit testing steps for those who are not familiar.
Comment #18
sonam.chaturvedi commentedVerified and tested patch #5. Patch applied successfully on 9.5.x-dev.
Updated steps to reproduce in issue summary.
Test Steps:
1. Install paragraph module
2. Create multiple paragraph types
3. Create a content type and add paragraph as reference field with 'Add mode' as buttons
4. Save the changes
5. Goto create content and check 'Add paragraphs' buttons have vertical margin
Test Results:

Seven theme: Ok
Claro theme: Ok

Olivero theme: Ok

Gin theme: Ok

RTBC +1
Comment #19
kristen pol@sonam.chaturvedi Thanks for testing!
It looks like the code was reviewed previously and this has been tested.
It would be good to do a double check of core gates before marking RTBC.
No more manual testing is needed, thanks!
Comment #20
smustgrave commentedReviewed the patch and looks good.
Still applies to 9.5
Comment #21
alexpottThis will need a 10.x patch because we no longer support IE so the result of yarn run build:css is different after applying this patch.
Comment #22
smustgrave commentedD10 patch
Comment #24
xyzsor commentedHello @smustgrave,
I have reviewed by applying your patch and it's working fine.
I am adding screenshot for reference, The screenshot is of before patch, i renamed it wrong so don't get confused.
Comment #25
xyzsor commentedApplied Patch #22 successfully. It is working as expected.
Comment #26
gaurav-mathur commentedComment #27
gaurav-mathur commentedPatch #22 applied successfully on on Drupal 10.0.x-dev,The patch work properly
but not working in Drupal 10.1.x-dev for me.
Refer to screenshots.
Comment #28
gaurav-mathur commentedComment #29
smustgrave commentedThank you for the interest @gaurav-mathur but screenshots were added in the comments before.
Comment #30
ranjit1032002Patch #22 applied successfully and it's working as expected
Comment #31
lauriiiThis adds some inconsistency to the spacing. This is quite visible on the top of the button. Ideally we would adjust the container margin to take this into account, but the
form-actionclass is used elsewhere and I'm not sure how easy it would be for us to add additional classes there. It's important that the spacing on top of the button remains somewhat where it is now because that way we make sure that users associate it to the right element, and it doesn't look too separate.Alternative solution we could try out is to handle this with margin-bottom, but that's likely not going to work because it will probably make the spacing on the bottom of the button inconsistent.
Comment #33
arantxioI've created a patch that applies to D10.2, it's kinda the same as #22, except it uses the margin-block instead of margin-top and bottom.
Comment #34
bhumikavarshney commentedHello @Arantxio,
Patch #33 applied successfully,The patch work properly.
please refer to screenshots.
Comment #35
smustgrave commentedThis needs to be made against 11.x as the development branch. And need to make sure #31 is addressed.
Comment #37
gauravvvv commentedAddressed #31 & #35.
Comment #39
meeni_dhobale commentedReviewing this current MR/commit.
Comment #40
meeni_dhobale commentedI am trying to review this commit on 11.x branch but I'm not able to reproduce the main issue.
Comment #41
dishakatariya commentedComment #42
dishakatariya commentedVerified and tested after taking pull from this branch- 3198236-add-another-buttons. (#38) on the Drupal version 11.x. Its working as expected for the various themes.
Followed the below Testing Steps:
1. Install paragraph module
2. Create multiple paragraph types
3. Create a content type and add paragraph as reference field with 'Add mode' as buttons
4. Save the changes
5. Goto create content and check 'Add paragraphs' buttons have vertical margin
Attaching the screenshot for reference.
Hence moving it to RTBC
Thanks!
Comment #46
lauriiiCommitted e16d8e0 and pushed to 11.x. Cherry-picked to 10.2.x as a non-disruptive bug fix to Claro. Thanks!