-
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
Fix Placeholder component padding when body text font size is changed #58323
Conversation
This has been happening since the font size control for the body text has been there, so we might be used to it being bigger than it appears now with this PR active, because the component's font size is 13px. I wonder if we need to alter the padding to give it more space? /cc @jasmussen |
Size Change: 0 B Total Size: 1.7 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 kind of bleed has been happening in so many ways and places. Until we can more easily apply Shadow DOM across things like these, explicit overrides seem the way to go.
What?
Follow up to #58303
This fixes the padding on the placeholder component when the Global styles typography settings change the font size of the body text.
Why?
The font size selected by the user or the theme for the body of the document is bleeding into the placeholder. The placeholder's padding will be bigger or smaller depending on the font size of the theme's body.
How?
The placeholder uses a padding of 1em. Because the wrapper of the component doesn't define a font size, CSS uses the one that is being inherited. In this case the one from the body. This PR defines a font size for the component, which will stay the same regardless of GS selections
Testing Instructions
Insert an image block to see the placeholder
Open Global styles / Typography / Text and change the font size value. With this PR the padding of the placeholder should stay the same.
Testing Instructions for Keyboard
Screenshots or screencast
Before
After