-
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
BlockInspector, ComplementaryArea: Fix overscoped p
style
#43866
Conversation
Size Change: +65 B (0%) Total Size: 1.25 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.
This looks like a decent approach — even though the real fix would have been not to write such widely scoped CSS selectors in the first place :(
Out of curiosity, have you considered increasing the specificity of the CSS rule in the BaseControl
component?
Yep, that also starts specificity battles with other overrides like this 😅 |
Thanks for fixing this, the toggle looks good again 🙏 I would echo Marco's comments that it'd be nice if there was a better solution. Would it be an option to leverage |
Exactly, that was one of the nicest options I considered! It's on our todo list to update the |
Proposed in #43995 |
What?
Fixes an overscoped
p
margin-top style in the editor sidebar.Why?
A regression in the Drop cap control was reported.
How?
I considered a couple approaches where this would be addressed in the ToggleControl component itself, like replacing the
p
with adiv
, or using a div wrapper and adding whitespace with VStack. However, these add extra complexity because we still need to maintain the legacy margin bottom behavior, and it can also easily break other style overrides.So in the end, I think the approach in this PR is probably the least bad.
Testing Instructions
First, change this
isDropCapFeatureEnabled
variable totrue
:gutenberg/packages/block-library/src/paragraph/edit.js
Line 83 in 4e41498
npm run dev
Screenshots or screencast