-
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
Set image size in percentages #4301
Conversation
20297e8
to
89d67d3
Compare
My initial reaction is that the image should be the size I set when I resize it, if we use percentage, it depends on the theme :). I guess that's the whole point of your PR but I think the current behavior is the right one :). The theme could provide editor styles to match its width? I'll defer to others though, I'd be fine with both. Noting that this breaks old images and we might want to provide a "deprecated" version if we want this in. |
I can understand both. Maybe in some cases you need to have it exactly set in pixels, though it could be argued that you could make the image exactly that size with image editing tools. In other cases, I don't feel like setting the size in pixels makes the content very portable across themes and other places where the content is displayed. |
@youknowriad Is there any recommended way to do this? I guess we might want to document this too for block authors. |
383753e
to
57dd2d6
Compare
3fece81
to
343b182
Compare
Closing this one again for now. May still be interesting, but the main image size issue was fixed. |
Description
This PR attempts to fix the issue where the width of the editor is different from the front-end, in which case the image might be a lot bigger or smaller than expected. This is especially an issue on small screen devices.
How Has This Been Tested?
Resize an image and verify that the size is set as a percentage of the content width.