Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upRemove max-width setting on image-block #14911
Conversation
This seems like a job for the align classes.
I'm not seeing `max-width` set for any other blocks.
Also, it overrides my theme's `article > * { max-width: $width; }`
This comment has been minimized.
This comment has been minimized.
|
Oops. Sorry for the crappy branch name. I created it directly in GitHub. |
| @@ -1,6 +1,4 @@ | |||
| .wp-block-image { | |||
| max-width: 100%; | |||
This comment has been minimized.
This comment has been minimized.
m-e-h
Apr 12, 2019
Author
Member
Maybe this was meant for editor.css. Just noticed that if I give .wp-block-image a non-100% max-width for the front-end, that it will override this and break the wide and full images in the editor.
This comment has been minimized.
This comment has been minimized.
jorgefilipecosta
May 30, 2019
Member
It seems like we could remove this style, in my tests I'm not noticing different behavior in 2019 theme when this style is set. Any thoughts on this @jasmussen, @kjellr?
This comment has been minimized.
This comment has been minimized.
kjellr
May 30, 2019
Contributor
Yeah, I think it's generally safe to remove this. Things seem to work fine without it on my end — tested in Twenty Nineteen, Twenty Thirteen, and the Gutenberg Starter theme.
It's true that if a theme were to set this to anything other than max-width: 100% in the editor, it'd break the editor's wide and full alignments. (@m-e-h, is that what you're referring to above?) But that would be the theme dev's decision to break things, so it'd be up to them to fix it. Everything seem to work fine if this style is removed out of the box.
This comment has been minimized.
This comment has been minimized.
paaljoachim
commented
Nov 2, 2019
|
@m-e-h. Hey Marty. Can we get a status update on this PR? Thanks. |
This comment has been minimized.
This comment has been minimized.
|
Both @jorgefilipecosta and @kjellr tested and found no issues with removing the CSS setting, however @m-e-h apparently is unsure :) Marking this as stale. |
This comment has been minimized.
This comment has been minimized.
|
Haha! Sorry @paaljoachim & @draganescu ! What would you like for a status update? A repo sync/update on the PR and some testing? I'm fine with closing this too. Whatever you all think. |
This comment has been minimized.
This comment has been minimized.
paaljoachim
commented
Nov 19, 2019
|
My logical brain is not functioning right now. So just go with whatever you think Marty..:) |
This comment has been minimized.
This comment has been minimized.
|
Pretty sure the initial reasoning for this to have been added was this: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_image_responsive2 That is, classic responsive images that don't scale beyond 1) the viewport, 2) the intrinsic dimensions of the image. However in this case it looks like it's applied to the block, not the |
|
Given that no one found any issues and @jasmussen gave some thumbs up this looks good to go :) |



m-e-h commentedApr 10, 2019
•
edited
Description
I'm not seeing
max-widthset for any other blocks.This seems like a job for the align classes.
Also, it overrides my theme's
article > * { max-width: $width; }Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: