Layout builder : Alignment and spacing issues on the edit layout page for content types.

Created on 4 July 2024, 6 months ago
Updated 19 September 2024, 3 months ago

Problem/Motivation

Alignment break and spacing issue in the layout builder.

Steps to reproduce

Step1 : Install Drupal
Step2 : Enable layout builder module
Step3 : Use Layout Builder from Administration > Structure > Content types > Article > Manage display > default > layout options
Step4 : Create Article from Content > Add content > Article and Save
Step5 : Click on Layout tab

Proposed resolution

Fix the styling of layout builder.

Solution - Fixed the alignment, justified the content and fixed the height of the anchor tag.
After -

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
CSSย  โ†’

Last updated 9 days ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep_patel Ahmedabad

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

Merge Requests

Comments & Activities

  • Issue created by @jaydeep_patel
  • Pipeline finished with Failed
    6 months ago
    Total: 221s
    #215833
  • Merge request !8666Issue #3458990 Alignment Issue Fixed โ†’ (Open) created by jaydeep_patel
  • Pipeline finished with Canceled
    6 months ago
    Total: 98s
    #215854
  • Pipeline finished with Failed
    6 months ago
    Total: 356s
    #215857
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep_patel Ahmedabad
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sanket.tale

    sanket.tale โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    6 months ago
    Total: 176s
    #216765
  • Pipeline finished with Success
    6 months ago
    Total: 527s
    #216804
  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep_patel Ahmedabad

    Alignment break and spacing issue has been fixed

  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sanket.tale

    MR has been created for the issue please review it and all unwanted changes have been removed.

  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dishakatariya

    Hi, I have verified this issue on D11 version as per #8 comment. The spacing and alignment looks fine now.

    Testing steps:
    Step1 : Install Drupal
    Step2 : Enable layout builder module
    Step3 : Use Layout Builder from Administration > Structure > Content types > Article > Manage display > default > layout options
    Step4 : Create Article from Content > Add content > Article and Save
    Step5 : Click on Layout tab

    Attached the Before and After Screenshot
    Hence can be move to RTBC
    RTBC+1

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Thanks for finding this and making an MR. When filing an issue, please keep all the headings in the issue summary so we can keep track of the work. Thanks.

    @DishaKatariya, when adding screenshots they should be linked to from the Issue summary so that reviewers can find the latest ones. I know this issue has few comments but it still helps to get into the habit. This information goes in the 'User interface changes' section.

    I don't review CSS so I can't comment on that. This does need a title that reflects what is being changed, in this case, where is the alignment problem? The issue title is used as the commit message, so it needs to make sense to people who are searching the git log.

  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Kanchan Bhogade

    Hi,
    I've tested this issue on DrupL 11.x
    The MR 8666 is appied cleanly..,
    The spacing and alignment looks fine now.

    Testing steps:

    1. Install Drupal
    2. Enable layout builder module
    3. Use Layout Builder from Administration > Structure > Content types > Article > Manage display > default > layout options
    4. Create Article from Content > Add content > Article and Save
    5. Click on Layout tab

    Attaching SS for reference
    Also the issue Title is updated...

    RTBC+1

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Can I ask where the min-height value came from?

  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    The alignment and spacing issues reported are not really bugs/problems - it is a vertical tab rendering exactly by design but it looks odd because there is only one tab.

    I see the benefit in creating alternate styling for vertical tabs if only one tab is present, but the solution here is not going to work because

    • It messes up the styling for instances when more than one tab is present
    • Even in this single-tag situation reported in the issue summar, it only "fixes" it for the contents of that specific tab with the "create new revision" checkbox. Tabs can contain anything so setting it to the height of what happens to be in there on your site is not a solution that would benefit any use of tabs outside of those with content that fills the exact same amount of pixels.
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    The novice tag is sufficient as this is in the CSS component, refer to the issue tag guidelines โ†’ .

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

    Only concerning factor in the MR is min-height: 5.125rem; which already @smustgrave already pointed out.

  • Pipeline finished with Success
    5 months ago
    Total: 461s
    #230889
  • Status changed to Needs review 5 months ago
  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia hetal.solanki

    Hii @all,

    I have reviewed, MR !8666. It's looks good.
    Moving to the RTBC.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia amanbtr72
  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    Neither point in #17 has been addressed.

  • Pipeline finished with Success
    5 months ago
    Total: 613s
    #232073
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep_patel Ahmedabad

    @bnjmnm, As per your comment #17 I didn't apply any changes on vertical tab. Instead of it I have removed extra margin from the top and bottom of "Create new revision" Checkbox field. So I think it will not affect if more than one tab is present. I have attached the screenshot "top-bottom-margin-removed.png" for reference.

  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep_patel Ahmedabad
  • Status changed to Needs work 5 months ago
  • The Needs Review Queue Bot โ†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sanket.tale

    sanket.tale โ†’ changed the visibility of the branch drupal-3458990-alignment-issue2 to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sanket.tale

    sanket.tale โ†’ changed the visibility of the branch drupal-3458990-alignment-issue2 to active.

  • Pipeline finished with Success
    5 months ago
    Total: 641s
    #238080
  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sanket.tale

    Patch re-rolling

  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    s per your comment #17 I didn't apply any changes on vertical tab. Instead of it I have removed extra margin from the top and bottom of "Create new revision" Checkbox field. So I think it will not affect if more than one tab is present. I have attached the screenshot "top-bottom-margin-removed.png" for reference.

    This new merge request 8888 has essentially the same problem but slightly worse
    In the MR I had concerns with in #17, it was because it was disrupting/breaking the styles of all vertical tabs to address the odd appearance when only one tab is present.

    This newer MR is disrupting the styles of all <details> these include the ones used to create vertical tabs but also every details element on the site.

    /* Details content wrapper */
    .olivero-details__wrapper {
      margin: var(--sp1);
    
      @media (--lg) {
        margin-block-start: var(--sp1-5);
        margin-block-end: var(--sp1-5);
        margin-inline-start: var(--sp2);
        margin-inline-end: var(--sp2);
      }
    

    In addition, the style changes of both these MRs only work if the tab is only one line long, it's not actually fixing the issue, it's just masking it for the specific content length and viewport width you're working with.

    As mentioned earlier, an approach that styles single-tab vertical tabs differently is your best bet.

  • sheetal.pathak โ†’ made their first commit to this issueโ€™s fork.

  • Hi
    Drupal version 11.x-dev
    Theme Olivero

    I have created MR to address issue for mis alignment. As per suggestions in #17 and #31 it needed to styles single-tab in vertical tabs.
    In MR I have added .first and .last classes , both of which appears when there is only one tab(refer after screenshot).
    If there are multiple vertical tabs, first tab will have .first class and last tab will have .last class. (Refer screenshot)

    Steps to review

    1. Enable layout builder module and select Olivero theme
    2. Use Layout Builder from Administration > Structure > Content types > Article > Manage display > default > layout options
    3. Create Article from Content > Add content > Article and Save
    4. Click on Layout tab

  • Pipeline finished with Failed
    3 months ago
    #287090
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    bnjmnm โ†’ changed the visibility of the branch 3458990-alignment-break-and to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bnjmnm Ann Arbor, MI

    The approach to styling a single tab in MR 8888 is good!

    Something I noticed is about the current solution: it only works if the tab contents are one line. Anything beyond that results in the same symptoms that were reported. We should find a solution that works regardless of the tab content length.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia amitrawat056

    I believe this issue is caused by ul.vertical-tabs__menu being given align-self: flex-start. To resolve it, unset this property using align-self: unset and provide height: 100% to both li.vertical-tabs__menu-item and the a tag. This should fix the problem.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Meeni_Dhobale

    I tried the solution provided the in the #38 but it doesn't work if there is more than 2 or 3 menu items. Instead of that I tried another with to setting position and alignment to unset. It works fine with the extra <li>'s and with extra menus as well.
    Attaching the before and after images.

    Before:

    With Single Item:

    With multiple <li> menu:

    With multiple menu items:

  • Pipeline finished with Failed
    3 months ago
    #303003
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep_patel Ahmedabad
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sagarmohite0031

    Hello, I've Verified this issue on D 11.x
    The MR is applied successfully.
    The spacing and alignment looks fine.

    Testing steps:-

    Install Drupal
    Enable layout builder module
    Use Layout Builder from Administration - Structure - Content types - Article - Manage display - default - layout options.
    Create Article from Content - Add content - Article and Save.
    Click on Layout tab

    Attaching screenshots-

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Needs a rebase most likely

    @sagarmohite0031 there are already multiple sets of screenshots attached to the ticket, additional ones are not needed please.

Production build 0.71.5 2024