backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

Field items vs. unpublished paragraph items #158

Open olafgrabienski opened 1 year ago

olafgrabienski commented 1 year ago

When a paragraph item is unpublished, the surrounding field item is empty but still rendered. This leads to styling issues with unpublished paragraph items on one of my sites, because field items are styled to have padding and a background color. With the following example, a paragraph takes some space, even if unpublished:

.field-name-field-paragraph > .field-items > .field-item {
    padding: 3rem 2rem 2rem;
}
.field-name-field-paragraph > .field-items > .even {
    background: #fff;
}

I guess, instead of the field-item, I could style the paragraphs-item inside of the field item. I'm however curious if it's possible to add a unpublished class to field items, to allow more flexibility.