- Issue created by @julien_capybara
When a user resize a media, the actual size in pixel is added to the media element with inline styling. Without extra styling, this can cause 2 issues :
A simple CSS line can fix this : "max-width: 100%;"
By applying this CSS rule to the media element, the media will never break out of its container. If the container is 1024px wide, the media element will not break out of that space even if the fixed size is larger. If the container/viewport changes size, the media will adapt itself to follow the width of its container.
We suggest to add a new boolean field "Set max width" to the filter's settings of the module. If enabled, an additional class would be added to the media element (.media-max-width) and the CSS rule would be applied thanks to an additional CSS file (instead of inline styling). This class can then easily be overridden at the theme level if needed.
Of course this change should be optional as it can affect the expected result in the front-end and might not suit everyone. But it could be useful to ensure a user such as a content editor doesn't break the layout of a site by adding medias that are too large or doesn't fix on all screens.
Create a patch to add the new feature.
A new boolean field "Set max width" will be added to the filter's settings.
Active
1.0
User interface