WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.58k stars 4.23k forks source link

Change Background color of paragraph block has different effect in styles and page-editor #38141

Open burnuser opened 2 years ago

burnuser commented 2 years ago

Description

Test with 5.9-RC3 and Twenty Twenty-Two: Asigning a background color in Styles => Blocks => Paragraph works Asigning a background color in Pages => Edit => Paragraph works But the result in the created webpage is different (see attached screenshot)

as reported in Core Trac: https://core.trac.wordpress.org/ticket/54865

Different layout for background color

Step-by-step reproduction instructions

see description above

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

jordesign commented 1 year ago

This is still present in WP6.3.

When a background is added in the page editor the paragraph receives additional style classes, including .has-background.

This then applies the style:

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

But when adding the background through global styles - no additional classes are added to the element.