How do I remove the paragraph parent wrapper?

In a standard Drupal install, the wrapper has the "field__item" class. In Bootstrap it has no attributes (see image). In both cases the unique paragraph attributes aren't on the same DOM level, making it impossible to use sibling CSS selectors.

For example, I can't do something like:

.paragraph {
     margin-top: 50px;
     margin-bottom: 50px;
}
.paragraph.paragraph--type--red-background + .paragraph.paragraph--type--red-background {
     margin-top: 0;
}

I'm guessing the solution is in twig, but I'm new to it and have spent the entire day searching for answers and experimenting with templates. Can somebody please point me in the right direction? I would think this would be the desired behaviour. Or is it a core limitation? Thanks in advance.

CommentFileSizeAuthor
paragraphs-html.png526.86 KBmarkdc

Comments

fatmarker created an issue. See original summary.

markdc’s picture

Issue summary: View changes

Clarifying title and description.

markdc’s picture

Title: How to remove attribute-less <div> wrapper? » How to remove generic parent wrapper?
berdir’s picture

Status: Active » Fixed

Have a look at https://www.drupal.org/docs/8/theming/twig/debugging-twig-templates on how to enable twig debug, that will tell you which template it is using, then you can add a template that doesn't add a wrapper if you don't want one.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

markdc’s picture

The issue seems to be with Entity Reference Revisions. See #2986140: Field lacks standard CSS classes and div wrapper