-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation screen: Add .editor-styles-wrapper #23736
Conversation
Surrounds the Navigation screen's BlockList with a .editor-styles-wrapper div. This allows CSS rules which override default block styling to work.
Size Change: +15 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving because this solves the problem, and it's the quickest approach to do so. But I think ultimately this is a problem of excessive specificity in our CSS, and the way editor-styles-wrapper
is now being used to increase specificity, or to target the editor specifically, feels the opposite direction to our aim of having the editor mirror the front end exactly.
Not sure if there's been any conversation about this, and there don't seem to be any rules against using that class, but because it started as an automated class added to theme editor styles, and hopefully editor styles will become unnecessary at some point, using it elsewhere will make it harder to remove when we no longer need it for that purpose.
Thanks @tellthemachines! Unsure if there's been any recent wider discussion around |
Follows #22656.
Fixes bug described in #22656 (review).
Surrounds the Navigation screen's
BlockList
with a.editor-styles-wrapper
. This is what is suggested in the docs.Doing this allows CSS rules which attempt to override default block styling to work in the Navigation screen. This includes the
margin: 0
which fixes the issue described in #22656 (review):gutenberg/packages/block-library/src/navigation/editor.scss
Lines 12 to 14 in 791be97
Before
After