-
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
Consider removing either the JS maxWidth
or the ability to set max-width from CSS
#7180
Comments
maxWidth
or the ability to set max-width from CSSmaxWidth
or the ability to set max-width from CSS
Thinking a bit more about this, we should probably drop the JS var and replace it with a small utility function returning the current editor width (that would run on render) and be globally accessible. Having a hard-coded width would fail on small screen devices when the responsive styling kicks in. |
I wonder if this is still being worked on? I see some elements (such as a DIV around a IMG within a wp-block-image) that is styled directly with "max-width: 580px", presumably from $maxWidth. |
@jasmussen - is it something we still need? |
I'm unsure. Maybe Andrew is best to respond? |
The If it is to be used for images, it needs to be correct, or it just messes things up. Perhaps a global utility function to get that from the current dom (i.e. what the user sees at the moment) would be better. On the other hand, fixing this would be best done when we know how themes are going to use context for images on the front-end, or if they will need something like that at all. (Ideally on the front-end all images will always have |
The editor width can be set by themes and plugins from CSS. At the same time there is a https://github.com/WordPress/gutenberg/blob/master/editor/store/defaults.js#L62
maxWidth
JS setting. Thinking there should be either one or the other, but not both.If we are keeping the CSS
max-width
, it would be great to have a property (maxWidth
,editorWidth
...) set in JS, but it will have to be set after the editor loads. Alternatively can disallow (always override) the CSSmax-width
in favor of the JSmaxWidth
. Plugins and themes can use that instead when they want to change it.The text was updated successfully, but these errors were encountered: