Skip to content

Preview styles are affecting the admin bar #513

@ryelle

Description

@ryelle

After an update to GB 13.9, the admin bar now has a max-width of 800px.

image

The offending style is the body > div > :where… from here, which is generated as part of "Core styles: block-supports".

.entry-content > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
body > div > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 800px;
  margin-left: auto !important;
  margin-right: auto !important;
}

This style is set up in the theme here, but in previous GB versions, this only output as the window.__editorStyles value passed into the pattern previews. Somehow it's being cached(?) and also output along with the regular theme layout styles.

This is probably the issue, WP_Style_Engine::store_css_rule(…: https://github.com/WordPress/gutenberg/blob/29d6801902ad97f749ccadd789a23b2d97369e3e/packages/style-engine/class-wp-style-engine.php#L613

Metadata

Metadata

Assignees

Labels

[Component] ThemeThe frontend of the pattern directory, pattern lists UI[Type] BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions