[wp-trac] [WordPress Trac] #52589: Twenty Twenty-One: Paragraph padding isn’t inherited in some div

WordPress Trac noreply at wordpress.org
Fri Feb 26 09:00:41 UTC 2021


#52589: Twenty Twenty-One: Paragraph padding isn’t inherited in some div
---------------------------+------------------------------
 Reporter:  ooker          |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:  5.6.1
 Severity:  major          |  Resolution:
 Keywords:                 |     Focuses:  ui, css
---------------------------+------------------------------

Comment (by domainsupport):

 Replying to [comment:12 poena]:

 Thank you for your detailed reply.

 We totally understand that a theme cannot provide styling for custom block
 plugins and that some plugins target popular themes with styling (such as
 the WooCommerce example you gave).

 That being said, please consider the following ...

 Gutenberg is obviously a visual editor and if no "inner-container" or
 other class is used, a block is shown as follows in the editor without
 adding any custom editor side CSS ...

 {{{
 <div class="wp-custom-block-wrapper-class"> <-- no margin
 <div class="wp-custom-block-inner-class"> <-- no margin
 <h3>Block Title</h3> <-- top and bottom 1em margin from ".editor-styles-
 wrapper h3 { margin-top: 1em; margin-bottom: 1em; }"
 <p>Block paragraph.</p> <-- top and bottom 1em margin from "p { margin:
 1em 0; }"
 </div>
 <div class="wp-custom-block-inner-class"> <-- no margin
 <h4>Another Block Title</h4> <-- top and bottom 1.33em margin from
 ".editor-styles-wrapper h3 { margin-top: 1.33em; margin-bottom: 1.33em; }"
 <img src="some-image.jpg" /> <-- no margin
 </div>
 </div>
 }}}

 ... however, when viewing the block live in Twenty Twenty-One, none of the
 above margins are present at all.

 So I think that although my question may seem more of a general Gutenberg
 one, is being demonstrated here with Twenty Twenty-One and is as follows
 ...

 **Surely in a visual editor, default margins shown on elements / blocks in
 the editor (be they built in or otherwise) should transcend to the front
 end theme?**

 Please advise because there seems to be some discrepancy here.

 Thank you in advance for your consideration,

 Oliver

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


More information about the wp-trac mailing list