field:not(:last-child) does not work with layout builder

Created on 1 September 2024, 17 days ago
Updated 11 September 2024, 8 days ago

Problem/Motivation

This selector does not work if layout builder is used and you show several fields on content type.

.field:not(:last-child) {
    margin-block-end: var(--sp2);
}

Steps to reproduce

  1. Create a few random fields on a content type.
  2. Enable layout builder for your content type.
  3. Reload the node
  4. bottom margin is gone

Proposed resolution

Add this selector to field.css

/**
 * Content type with layout builder enabled
 */
.layout__region .block-layout-builder:not(:last-child) .field {
    margin-block-end: var(--sp2);
}

Remaining tasks

Code review

User interface changes

Before fix

After fix

API changes

None

Data model changes

None

๐Ÿ› Bug report
Status

Needs review

Version

11.0 ๐Ÿ”ฅ

Component
Oliveroย  โ†’

Last updated about 10 hours ago

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany marc.bau

Live updates comments and jobs are added and updated live.
  • Needs screenshots

    The change alters the user interface, so before and after screenshots should be added to document the UI change. Make sure to capture the relevant region only. Use a tool such as Aviary on Windows or Skitch on Mac OS X.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024