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

Created on 4 July 2024, 2 months ago
Updated 31 July 2024, about 1 month 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 1 day ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep.jdb@gmail.com Ahmedabad

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

Merge Requests

Comments & Activities

  • Issue created by @jaydeep.jdb@gmail.com
  • Pipeline finished with Failed
    2 months ago
    Total: 221s
    #215833
  • Pipeline finished with Canceled
    2 months ago
    Total: 98s
    #215854
  • Pipeline finished with Failed
    2 months ago
    Total: 356s
    #215857
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep.jdb@gmail.com Ahmedabad
  • sanket.tale โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    2 months ago
    Total: 176s
    #216765
  • Pipeline finished with Success
    2 months ago
    Total: 527s
    #216804
  • Status changed to Needs review 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep.jdb@gmail.com Ahmedabad

    Alignment break and spacing issue has been fixed

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

  • Status changed to RTBC 2 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 2 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand

    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 2 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand
  • ๐Ÿ‡ฎ๐Ÿ‡ณ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 about 2 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 New Zealand

    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
    about 2 months ago
    Total: 461s
    #230889
  • Status changed to Needs review about 2 months ago
  • Status changed to RTBC about 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Hetal.Solanki

    Hii @all,

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

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

    Neither point in #17 has been addressed.

  • Pipeline finished with Success
    about 2 months ago
    Total: 613s
    #232073
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jaydeep.jdb@gmail.com 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 about 2 months ago
  • Status changed to Needs work about 2 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.

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

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

  • Pipeline finished with Success
    about 1 month ago
    Total: 641s
    #238080
  • Status changed to Needs review about 1 month ago
  • Status changed to Needs work about 1 month 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.

Production build 0.71.5 2024