When one sets the layout of an Umami recipe page with Layout Builder to use more columns there is no vertical space between the content of columns when the page is displayed.

Umami recipe page with two columns sections, no space between the colums.

Issue fork drupal-3061987

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:

  • 3061987- Comparecompare
  • 3061987-no-space-between Comparecompare

Comments

thamas created an issue. See original summary.

thamas’s picture

Issue summary: View changes
tanmayk’s picture

Version: 8.7.x-dev » 8.8.x-dev
Component: Umami demo » CSS
StatusFileSize
new37.46 KB

Not just umami demo, but this can be seen with Bartik theme.

Spacing issue

We should update the styles in Layout Builder to add padding or margin between columns.

tanmayk’s picture

Title: No space between columns of Layout Builder on Umami recipe page » No space between columns of Layout Builder

Changing the title to make it more generic.

dyannenova’s picture

Each theme needs to set its own CSS for this, otherwise Layout Builder will be making assumptions about column padding that would need to be overwritten in every theme.

johnwebdev’s picture

#5 +1

It should be done in themes.

tanmayk’s picture

Yes, agreed.

thamas’s picture

So should we create separate issues for themes?

tanmayk’s picture

After giving it a bit of thought, why shouldn't we add default spacing from layout builder? If we give the spacing from a theme, each & every theme (including contributed too), have to take care of it. I am sure all themes would need that space.

Instead, we should give some ideal spacing from layout builder & then any theme can override it if needed. Thoughts?

thamas’s picture

@tanmayk While adding space from layout builder could be a quick win, we can't set an "ideal spacing" as the ideal spacing depends on the ratios (font sizes, component sizes, other spacings) of the theme. (As mentioned by @DyanneNova in #5)

So I think as well we better set the spacing in each core theme separately and these can be examples for contrib and custom themes too.

So we may keep this as a meta issue and create separate related issues for each core theme. Thoughts?

tanmayk’s picture

That makes sense @thamas. Thanks.

smaz’s picture

I would have thought we should have a 'sensible' default (as much as possible) so that rather than every single theme having to specify padding/margin to fix the issue, some will have to to make it more suitable for their theme. If doing it per theme means that people have to specify it for their theme, that's not much different than having to override a default.

I would guess though that this should be done in the Stable core theme, which is the default base theme, rather than in the layout builder module so that if you didn't have a base theme/didn't want the default styles, you wouldn't have to have them?

For setting the margin/padding can we use em so that it scales with default font sizes etc., like we did for the padding on the add link here? https://www.drupal.org/project/drupal/issues/3050225

thamas’s picture

I'm not sure if we may change Stable as it has to be "stable". (I do not know if adding plus thing is possible without changing earlier code…)

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.

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.

djsagar’s picture

Status: Active » Needs review
StatusFileSize
new1.54 KB

Hi all,

For space between columns of Layout Builder i created patch which is resolved spacing issue between columns.

Please review and give feedback.

Thanks!

kapilv’s picture

StatusFileSize
new1.54 KB
abhijith s’s picture

StatusFileSize
new1.53 KB

Fixed the custom command issue in patch #18

djsagar’s picture

StatusFileSize
new922 bytes
new1.54 KB

I uploaded patch with interdiff.

Status: Needs review » Needs work

The last submitted patch, 20: 3061987-20.patch, failed testing. View results

djsagar’s picture

Status: Needs work » Needs review
StatusFileSize
new1.53 KB

rolling up patch interdiff were added on #20.

gauravvvv’s picture

StatusFileSize
new262.45 KB

This issue has been addressed in 9.2
Adding screenshot of fresh Drupal 9.2 install.
No more reproducible in D9.2

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.

leisurman’s picture

As mentioned to do in #5. Add the styles from patch #22 to your custom theme or upgrade to Drupal core 9.2.0. Is that correct?

/* Layout builder padding issue*/
/*https://www.drupal.org/project/drupal/issues/3061987*/
/* XXXXXXXXXXXXXXXXXXXXXXXXXX */

.layout__region {
  box-sizing: border-box;
  margin: 10px 0;
}

.layout__region--top {
  margin-top: 0;
}

.layout__region--bottom {
  margin-bottom: 0;
}

[class*="layout__region--first"] {
  padding-right: 15px;
}

[dir="rtl"] [class*="layout__region--first"] {
  padding-right: 0;
  padding-left: 15px;
}

[class*="layout__region--second"] {
  padding-left: 15px;
}

[dir="rtl"] [class*="layout__region--second"] {
  padding-right: 15px;
  padding-left: 0;
}

.layout__region--third {
  padding-left: 30px;
}

[dir="rtl"] .layout__region--third {
  padding-right: 30px;
  padding-left: 0;
}

@media screen and (max-width: 40em) {
  .layout__region {
    padding: 0;
  }
}
leisurman’s picture

It works for me. Thank you.

leisurman’s picture

I gues we should also add a style for .layout__region layout__region--fourth

.layout__region--fourth {
  padding-left: 30px;
}

[class*="layout__region--fourth"] {
  padding-left: 15px;
}
tim.plunkett’s picture

Category: Bug report » Support request

Changing this to a support request for now. If there's a concrete proposal to change each of the non-base themes that ship with core, that's fine. But per #5 we won't be changing this in the base themes.

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.

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

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

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

djsagar’s picture

Project: Drupal core » Bartik
Version: 11.x-dev » 1.0.2
Component: CSS » Look and Feel

Hello everyone,

As Bartik has been removed from the Drupal core, I suggest that we either close this issue or retest using a different theme.

Thanks!