Skip to content

The default editor styles are loaded after the core blocks' editor styles #24011

Closed

Description

@ZebulanStanphill

Description

The styles in packages/editor/src/editor-styles.scss are loaded after packages/block-library/src/editor.scss. I would expect them to be loaded before.

Because of the editor style wrapping that currently happens, style rules like ul become .editor-styles-wrapper ul, which has a specificity of 0-1-1, and so even a style rule in a core block's editor.scss like ul.has-background (which has the same specificity) will be overridden, because the default editor styles are applied after.

I discovered this issue while working on #21387, where I ran into the exact scenario described in the previous paragraph.

Expected behavior

The editor styles provided by the core blocks would be applied after the default editor styles, not before.

Environment

  • WordPress 5.4.2
  • Gutenberg plugin 8.5.1

Activity

  1. added
    [Type] Bug
    CSS Styling
    on Jul 17, 2020
  2. skorasaurus commented on Feb 8, 2021

    @skorasaurus
    Member

    Is this a duplicate of #21785 ?

  3. ZebulanStanphill commented on Feb 9, 2021

    @ZebulanStanphill
    MemberAuthor

    @skorasaurus Yeah, it's a duplicate of #21785. I must have forgotten I made the earlier issue. Thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSS Styling[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions