Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default editor styles load after core blocks' editor styles, rather than before. #21785

Closed
ZebulanStanphill opened this issue Apr 22, 2020 · 1 comment · Fixed by #30034
Closed
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Bug An existing feature does not function as intended

Comments

@ZebulanStanphill
Copy link
Member

ZebulanStanphill commented Apr 22, 2020

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
@ZebulanStanphill ZebulanStanphill added [Type] Bug An existing feature does not function as intended CSS Styling Related to editor and front end styles, CSS-specific issues. labels Apr 22, 2020
@ZebulanStanphill ZebulanStanphill changed the title Default editor styles load after block styles. Default editor styles load after core blocks' editor styles. Feb 9, 2021
@ZebulanStanphill ZebulanStanphill changed the title Default editor styles load after core blocks' editor styles. Default editor styles load after core blocks' editor styles, rather than before. Feb 9, 2021
@ZebulanStanphill
Copy link
Member Author

I've created #30094 to remove the now-unnecessary editor styles for the List block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant