-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update/site logo constrain image #41298
Conversation
cc @WordPress/block-themers |
@scruffian It looks like you currently based this branch off #34180 Is there any reason for that? |
Oops no, just clumsiness! |
cc82252
to
4dfbd8c
Compare
Fixed! |
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.
LGTM 👍
Simple, and makes perfect sense to do this for the site-logo.
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.
Makes perfect sense :)
Size Change: +27 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
@scruffian just wanted to note that this new implementation can cause some pretty unexpected behavior when Site Logo blocks are placed in Row blocks. From a technical standpoint, it makes sense why this would be happening, but will likely surprise folks, especially since the Editor and frontend views are not consistent (Image blocks behave the same way as you indicated). Here is a simple example:
|
What?
This forces images inside the Site Logo block to be constrained to their parent container. Closes #41115
Why?
This seems to match user expectation. It prevents larger images from flowing offscreen.
How?
We set the height of the image to
auto
and set amax-width: 100%
which is the same trick the image block uses to achieve this effect.Testing Instructions
Screenshots or screencast
site-logo.mov
Limitations
This CSS doesn't take effect in the editor, as the resizeable box allows the logo to expand wider than its container. I'm not sure how we get round this, but the same is true of the image block.