-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Default editor styles load after core blocks' editor styles, rather than before. #21785
Copy link
Copy link
Closed
Labels
CSS StylingRelated to editor and front end styles, CSS-specific issues.Related to editor and front end styles, CSS-specific issues.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CSS StylingRelated to editor and front end styles, CSS-specific issues.Related to editor and front end styles, CSS-specific issues.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.