[wp-trac] [WordPress Trac] #48336: Global block editor image styles causing problems

WordPress Trac noreply at wordpress.org
Fri Oct 18 00:41:06 UTC 2019


#48336: Global block editor image styles causing problems
--------------------------+------------------------------
 Reporter:  dennis_f      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  ui
--------------------------+------------------------------

Comment (by dennis_f):

 Replying to [comment:2 joyously]:
 > That CSS is best practice and not very specific. If there are plugins or
 themes that need something else, they would make it more specific and
 easily override that rule.

 While I agree that `max-width:100%` is a good practice for simple images
 added to the content of pages/posts, I think it's false to assume that
 every single image on the website will have to follow this rule. Websites
 often contain various dynamic elements, such as sliders, galleries, etc.,
 and those elements may rely on the browser's default image `max-width`,
 which is `"none"`.

 In my particular case I have a header image slider with a fixed height.
 When the slider contains an image that is wider than the slider container,
 it overflows the container so we can keep the slider's height static (the
 image gets centered in its container). With the new `max-width:100%` rule,
 the image now looks squished.

 The editor styles should be scoped to the editor elements only and not
 enforced globally to all elements on the front-end. Images are too widely
 used in various setups to assume that `max-width:100%` will work for all
 of them.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48336#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list