[wp-trac] [WordPress Trac] #54865: Change Background color of paragraph block has different effect in styles and page-editor

WordPress Trac noreply at wordpress.org
Thu Jan 20 22:51:20 UTC 2022


#54865: Change Background color of paragraph block has different effect in styles
and page-editor
--------------------------+------------------------------
 Reporter:  burnuser      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by sabernhardt):

 * component:  Formatting => Editor


Comment:

 Thanks for the report!

 The padding comes from applying the background to that specific paragraph
 block, using a `has-background` class.

 {{{
 p.has-background {
   padding: 1.25em 2.375em;
 }
 }}}

 ([https://github.com/WordPress/gutenberg/blob/1baa7106dfbc4b61217090eac3ac06bf432a4e5f/packages
 /block-library/src/paragraph/style.scss#L41-L43 paragraph block styles
 SCSS has had padding since 2018])

 Global style settings do not assign the class and only change the block's
 color. To make these consistent, the global styles would need to add
 padding to all paragraphs where the specially-colored blocks would appear.

 On the other hand, I do not consider applying a background color to the
 paragraph element very useful. That affects paragraphs in the header and
 footer, too.

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


More information about the wp-trac mailing list