close
Skip to content

Container Queries break editor style loading #49862

@tomjn

Description

@tomjn

Description

Adding an editor stylesheet to a theme does not work if that stylesheet contains CSS container queries.

This includes styles that are not container queries.

Step-by-step reproduction instructions

Add a container query such as the following to the editor stylesheet:

/* Default heading styles for the card title */
.card h2 {
  font-size: 1em;
}

/* If the container is larger than 700px */
@container (min-width: 700px) {
  .card h2 {
    font-size: 2em;
  }
}

Now load the editor and observe that all editor styles from the file fail to be applied.

Screenshots, screen recording, code snippet

No response

Environment info

WP 6.2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSS StylingRelated to editor and front end styles, CSS-specific issues.[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Status] DuplicateUsed to indicate that a current issue matches an existing one and can be closed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions