Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#54944 closed defect (bug) (fixed)

By applying a background color to a group block, it aligns to the left in the editor

Reported by: eddystile's profile eddystile Owned by: audrasjb's profile audrasjb
Milestone: 5.9.1 Priority: normal
Severity: normal Version: 5.9
Component: Bundled Theme Keywords: has-screenshots has-patch fixed-major
Focuses: css Cc:

Description

With Twenty Twenty Two theme, in a post edition, when applying a color background to a group block, this block align to left in the editor. It's ok in front.

Attachments (3)

alignement.gif (915.4 KB) - added by eddystile 3 years ago.
740c85cc2a545e98ca61d74b193651e2.gif (886.3 KB) - added by audrasjb 3 years ago.
Before patch
b40771bdcd6cd527be737a593fc78bd7.gif (748.9 KB) - added by audrasjb 3 years ago.
After applying the proposed patch: works great!

Change History (18)

@eddystile
3 years ago

#1 @audrasjb
3 years ago

  • Component changed from General to Bundled Theme
  • Keywords has-screenshots added
  • Milestone changed from Awaiting Review to 5.9.1
  • Owner set to audrasjb
  • Status changed from new to reviewing

Hello and thanks for the report @eddystile,

I can reproduce the issue using TT2 and WP 5.9.
We need to make sure the issue is not coming from Gutenberg side, though.

Moving for 5.9.1 consideration.

#2 @webmandesign
3 years ago

Just a quick note here as I haven't tested this thoroughly, but I just dealt with a customer experiencing similar issue.

I've found out the issue was coming in my case from Gutenberg plugin applying margin: 0; on the affected block (where horizontal margins of auto coming from theme were effectively overridden with this). Not sure why though. After disabling Gutenberg plugin the issue disappeared.

Hope this helps somehow if it is related.

#3 @sabernhardt
3 years ago

  • Focuses css added

Twenty Twenty-Two has had negative side margins on group blocks with a background since PR 336

This ticket was mentioned in PR #2281 on WordPress/wordpress-develop by petaryoast.


3 years ago
#4

  • Keywords has-patch added

@audrasjb
3 years ago

After applying the proposed patch: works great!

#5 @audrasjb
3 years ago

  • Keywords commit added

Marking this for commit. Thanks for the PR @petaryoast!

#6 @audrasjb
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 52679:

Twenty Twenty-Two: Remove negative side margins on group blocks with a background.

This change fixes an issue where applying a background color to a group block aligned it to the left in the editor.

Props eddystile, audrasjb, webmandesign, sabernhardt, petaryoast.
Fixes #54944.

#7 @audrasjb
3 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 5.9 backport.

#9 @kjellr
3 years ago

Just a heads up that the padding rule does not need to be removed in order to fix the margins issue. I opened #55103 to restore it.

#10 @audrasjb
3 years ago

  • Keywords commit removed

@kjellr if I understand your point correctly:
body > .is-root-container > .wp-block-group.has-background can be removed as it addresses the issue reported in this ticket, but we shouldn't remove .wp-block-group.has-background,?

#11 @kjellr
3 years ago

Yes, that's correct.

#12 @audrasjb
3 years ago

Ok thanks for the confirmation 👍

#13 @audrasjb
3 years ago

In 52686:

Twenty Twenty-Two: Restore custom padding for group blocks with a background color.

This change partially reverts [52679] which accidentally removed custom padding for group blocks with a background color.

Follow-up to [52679].

Props kjellr.
Fixes #55103.
See #54944.

#14 @audrasjb
3 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 52688:

Twenty Twenty-Two: Remove negative side margins on group blocks with a background.

This change fixes an issue where applying a background color to a group block aligned it to the left in the editor.

Props eddystile, audrasjb, webmandesign, sabernhardt, petaryoast, kjellr.
Merges [52679] and [52686] to the 5.9 branch.
Fixes #54944, #55103.

#15 @SergeyBiryukov
3 years ago

In 52709:

Twenty Twenty-Two: Update mergeinfo after [52688].

See #54944, #55103.

Note: See TracTickets for help on using tickets.