Quantcast
Viewing all articles
Browse latest Browse all 295999

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

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

Image may be NSFW.
Clik here to view.
before-fix

After fix

Image may be NSFW.
Clik here to view.
after-fix

API changes

None

Data model changes

None


Viewing all articles
Browse latest Browse all 295999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>