Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Layout issues around <wp-block> and display: contents #49

@yscik

Description

@yscik

Themes commonly style the top-level content elements, like .entry-content > *, for layout and spacing, eg to allow various alignments. Example:

.entry-content > :not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide) {
  max-width: 58rem;
  width: calc(100% - 4rem);
	}
.entry-content > * {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25em;
}

This doesn't really work with display: contents on the <wp-block> wrapper:

Current Expected
image image

One option is inheriting these spacing styles that would apply to the wrapper:

wp-block > * {
	margin: inherit;
	max-width: inherit;
	width: inherit;
}

I'm not sure that's enough for every theme, this would need wider testing and some strategy to keep compatibility with existing theme and possibly plugin styles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions