Problem/Motivation

A visual regression where the inline machine name is right up against the field it follows.

Proposed resolution

(modified with RTL support)

[dir="ltr"] span.machine-name-label {
  margin: 0 0 0 0.5em;
}
[dir="rtl"] span.machine-name-value {
  margin: 0 0.5em 0 0;
}

NB: rebuild caches after applying patch

Before LTR:

before

After LTR:

after

Before RTL:

before

After RTL:

after

Remaining tasks

Review

User interface changes

space between field and it's machine name label.

API changes

None

Data model changes

None

CommentFileSizeAuthor
#44 Machine_name_label_crashing_into_field-2821827-44.patch418 bytesrakhi soni
#37 After--patch.jpeg88.06 KBManibharathi E R
#37 before--patch.jpeg84.08 KBManibharathi E R
#30 label-after-patch.png59.97 KBMadhu kumar
#30 label-before-patch.png54.95 KBMadhu kumar
#29 after-patch-rtl.png61.42 KBbhumikavarshney
#29 after-patch-ltr.png53.5 KBbhumikavarshney
#29 before-patch-rtl.png61.33 KBbhumikavarshney
#29 before-patch-ltr.png58.07 KBbhumikavarshney
#28 interdiff_2821827_24-28.txt423 bytesankithashetty
#28 2821827-28.patch418 bytesankithashetty
#25 After--patch-RTL.jpg85.87 KBranjith_kumar_k_u
#25 Before--patch-RTL.jpg86.11 KBranjith_kumar_k_u
#25 After--patch-LTR.jpg88.06 KBranjith_kumar_k_u
#25 before--patch-LTR.jpg84.08 KBranjith_kumar_k_u
#24 2821827-24.patch421 bytesramya balasubramanian
#21 Screenshot 2020-09-12 at 11.45.25 PM.png83.51 KBanmolgoyal74
#18 BP RTL Space.png331.56 KBchetanbharambe
#18 BP LTR Space.png330.06 KBchetanbharambe
#18 AP RTL Space.png382.09 KBchetanbharambe
#18 AP LTR Space.png327.03 KBchetanbharambe
#16 2821827-16.patch421 byteskiran.kadam911
#16 after_patch_RTL.png204.92 KBkiran.kadam911
#16 after_patch_LTR.png202.4 KBkiran.kadam911
#16 Issue_RTL.png203.44 KBkiran.kadam911
#16 Issue_LTR.png203.86 KBkiran.kadam911
#9 machine_name_label-2821827-8.patch457 byteswturrell
#9 interdiff-2821827-2-9.txt502 byteswturrell
#9 2821827-ltr-after-v2.png23.9 KBwturrell
#8 2821827-rtl-after-v2.png24.63 KBwturrell
#8 2821827-rtl-before.png24.46 KBwturrell
#2 machine-name-label-crashing-into-field-2821827-2-8.3.x-dev.patch367 bytesprashant.c
#2 After.png16.49 KBprashant.c
#2 Before.png11.93 KBprashant.c

Issue fork drupal-2821827

Command icon 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:

Issue fork seven-2821827

Command icon 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:

Comments

tkoleary created an issue. See original summary.

prashant.c’s picture

Status: Active » Needs review
StatusFileSize
new11.93 KB
new16.49 KB
new367 bytes

This could be added.

1. Adding patch in elements.css file.
2. Attaching before-after screenshots.

Patch needs to be reviewed.

wturrell’s picture

Issue summary: View changes

Added inline screenshots to summary, plus reminder to clear cache.
Patch works (though I've not searched for regressions elsewhere)
Coding style fine.

Needs browser testing.

Nobody's currently listed as a maintainer for seven...?

dinesh18’s picture

Patch works as expected.

krina.addweb’s picture

Status: Needs review » Reviewed & tested by the community

Hi Prashant.c ,Thanks! for the patch it works the same for me.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/seven/css/base/elements.css
@@ -172,3 +172,6 @@ details summary:focus,
+  margin: 0.5em;

This is applying margin to the top and bottom and does not match the solution proposed in the issue summary. Plus given that we're dealing with horizontal margins it would be good to get an rtl screenshot too.

wturrell’s picture

Issue summary: View changes
StatusFileSize
new24.46 KB
new24.63 KB

(Ignore this)

wturrell’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new23.9 KB
new502 bytes
new457 bytes

@alexpott - Ugh, sorry, not sure how I failed to spot that. And yes, needed adjusting for RTL too as .machine-name-label and .machine-name-value are displayed adjacently inline. Issue summary updated with new code and screenshots.

Could someone else please review?

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

kiran.kadam911’s picture

Issue summary: View changes
StatusFileSize
new203.86 KB
new203.44 KB
new202.4 KB
new204.92 KB
new421 bytes

Re-rolled with 9.1.x, Kindly review the attached patch.

Before patch SS:

After patch SS:

Thanks!

chetanbharambe’s picture

Assigned: Unassigned » chetanbharambe
chetanbharambe’s picture

StatusFileSize
new327.03 KB
new382.09 KB
new330.06 KB
new331.56 KB

Verified and tested patch #16.
Patch applied successfully and looks good to me.

Testing Steps:

# Go to Structure
# Go to Content Type
# Click on Manage fields - In front of basic page
# Click on Add Field
# SELECT ANY field in Add new field
# Fill any name in label field box
# User is able to see "Machine name: field_date‎"
# Should have some space after the label field box
# Check this for LTR and RTL

Can be a move to RTBC.
Please refer attached screenshots

chetanbharambe’s picture

Assigned: chetanbharambe » Unassigned
Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: 2821827-16.patch, failed testing. View results

anmolgoyal74’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new83.51 KB

Looks like un-related fail. Marking it as RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: 2821827-16.patch, failed testing. View results

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

ramya balasubramanian’s picture

Status: Needs work » Needs review
StatusFileSize
new421 bytes

Rerolled the patch for 9.2 dev. Please have a look.

ranjith_kumar_k_u’s picture

StatusFileSize
new84.08 KB
new88.06 KB
new86.11 KB
new85.87 KB

The above patch works fine.

Before patch LTR
before patch

After patch LTR
after patch

Before patch RTL
before patch

After patch RTL
after patch
RTBC

ranjith_kumar_k_u’s picture

Status: Needs review » Reviewed & tested by the community
lauriii’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/seven/css/base/elements.css
@@ -180,3 +180,9 @@ img {
+[dir="ltr"] span.machine-name-label {
+  margin: 0 0 0 0.5em;

We can remove the dir="ltr" from this selector. We should add inline comment to the margin to explain that it's only for LTR.

I'm also wondering if we need to use the margin property and override all of the margin values or could we use just margin-left?

ankithashetty’s picture

Status: Needs work » Needs review
StatusFileSize
new418 bytes
new423 bytes

Agree with the changes suggested by @lauriii in #27. Updating the patch in #24 as per suggestions in #27. Kindly review.

Thank you!

bhumikavarshney’s picture

StatusFileSize
new58.07 KB
new61.33 KB
new53.5 KB
new61.42 KB

The above patch works fine for me.
Thanks
RTBC+1

Madhu kumar’s picture

StatusFileSize
new54.95 KB
new59.97 KB

Patch #28 applied cleanly and it is working well. Added screenshot for reference.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Harish1688’s picture

Tested the patch (2821827-28.patch) with (9.5.x-dev and below version), it's working fine applied space between the label field and machine name in both LTR and RTL cases, good for RTBC.

Aamir M’s picture

Assigned: Unassigned » Aamir M
Aamir M’s picture

Assigned: Aamir M » Unassigned
Manibharathi E R’s picture

StatusFileSize
new84.08 KB
new88.06 KB

Patch #28 applied successfully and it is working fine.
Before Patch Apply:
After_patch
After Patch Apply
After_patch

Munavijayalakshmi made their first commit to this issue’s fork.

Munavijayalakshmi’s picture

Assigned: Unassigned » Munavijayalakshmi
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new19.66 KB
new201.72 KB

No need to apply the #28 patch.
Already space available before machine name in branch 9.5.x.

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
meeni_dhobale’s picture

Status: Reviewed & tested by the community » Needs review

Reviewed patch mentioned in #28 with Drupal 9.5.x-dev. Works fine for me. Space added in between label and machine name in LTR and RTL in both scenarios. RTBC +1.

meeni_dhobale’s picture

Status: Needs review » Reviewed & tested by the community
bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
  1. --- a/core/themes/seven/css/base/elements.css
    +++ b/core/themes/seven/css/base/elements.css
    

    There's an issue with this solution on narrower widths. When the viewport is small enough for the input to be 100% width, the machine name is moved below the input, then has an unwanted indent. Perhaps this can be wrapped in the same media query that makes the input 100% width?

  2. +++ b/core/themes/seven/css/base/elements.css
    @@ -180,3 +180,9 @@ img {
    +span.machine-name-label {
    

    No need to include the span here or in machine-name-value

  3. +++ b/core/themes/seven/css/base/elements.css
    @@ -180,3 +180,9 @@ img {
    +  margin-left: 0.5em; /* LTR */
    

    This doesn't need the LTR because it isn't changed in the RTL style

  4. +++ b/core/themes/seven/css/base/elements.css
    @@ -180,3 +180,9 @@ img {
    +[dir="rtl"] span.machine-name-value {
    

    This probably doesn't have to be RTL, the margin on the right isn't disruptive if it's in LTR.

rakhi soni’s picture

Status: Needs work » Needs review
StatusFileSize
new418 bytes

Kindly review patch for version 9.5x,,,

bnjmnm’s picture

Status: Needs review » Needs work

#44 is just the patch from #28. I requested changes to that patch in #43 that have not been addressed.

Rerolled patches are only needed if the patch no longer applies to the current dev branch of Drupal. You can determine if a patch needs a reroll (such as #28), click "Add test / retest" and choose to test on the current dev branch. I just did this for #28 and the patch applies on 9.5, which confirms the reroll in #44 was not needed.

Even if the reroll WAS needed, it should not have been set to "Needs Review", because my review feedback in #43 hasn't been addressed, so it still "Needs Work"

jatingupta40’s picture

@bnjmnm Can you please add a screenshot so it will be easier to understand?

Thanks

sourabhjain’s picture

Assigned: Unassigned » sourabhjain

I will work on this.

sourabhjain’s picture

Assigned: sourabhjain » Unassigned
longwave’s picture

Project: Drupal core » Seven
Version: 9.5.x-dev » 1.0.0-alpha1
Component: Seven theme » Code

The Seven theme has been removed from Drupal 10 core. I confirmed that this issue only affects Seven and no other themes included with Drupal core, so I am moving this to the contributed Seven project.

avpaderno’s picture

Version: 1.0.0-alpha1 » 1.0.x-dev
avpaderno’s picture

Issue tags: +CSS
avpaderno’s picture

Title: Machine name label crashing into field » The machine name label gets too close to the next field

avpaderno changed the visibility of the branch 2821827-machine-name-label to hidden.

avpaderno’s picture

Status: Needs work » Needs review

  • avpaderno committed 4b8e2149 on 1.0.x
    Issue #2821827: The machine name label gets too close to the next field
    

  • avpaderno committed f7a4e270 on 2.0.x
    Issue #2821827: The machine name label gets too close to the next field
    
avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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