Make WordPress Core

Opened 5 months ago

Closed 4 months ago

#61611 closed defect (bug) (fixed)

Twenty Twenty-One: float-clearing pseudo-elements are visible in Row and Grid blocks

Reported by: up1512001's profile up1512001 Owned by: karmatosed's profile karmatosed
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch needs-testing commit
Focuses: css Cc:

Description

  • The grid layout looks different on the front-end and back-end.

https://github.com/Automattic/themes/issues/7943

Attachments (1)

style.css (151.8 KB) - added by up1512001 5 months ago.
remove before and after from wp-block-group.

Download all attachments as: .zip

Change History (22)

@up1512001
5 months ago

remove before and after from wp-block-group.

This ticket was mentioned in PR #7001 on WordPress/wordpress-develop by @up1512001.


5 months ago
#1

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/61611

This is an issue with the TT1 theme I checked it's due to this code present in the style.css file at the 2154 line number.

.wp-block-group:before,
.wp-block-group:after {
        content: "";
        display: block;
        clear: both;
}

### before removing this code
https://github.com/WordPress/gutenberg/assets/75293077/5daca660-6a6d-4987-9879-e8a854bc33e2

### after removing this code
https://github.com/WordPress/gutenberg/assets/75293077/9cbfd7df-cf96-4383-8a20-a157ed8d7989

#2 @sabernhardt
5 months ago

  • Component changed from Themes to Bundled Theme
  • Focuses ui removed
  • Keywords changes-requested added
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Issue with TT1 theme with grid block to Twenty Twenty-One: float-clearing pseudo-elements are visible in Row and Grid blocks
  • Version trunk deleted

The patch will need to edit twentytwentyone/assets/sass/05-blocks/group/_style.scss and build files from that.

  • The pseudo-elements are part of an IE hack.
  • The hack could be moved to 07-utilities/ie.scss instead of just deleting it.
  • The front-end styles could keep display: flow-root in group/_style.scss for older versions of WordPress that do not set the flex or grid display.
  • [55329] removed the entire section of float-clearing styles (including flow-root) from the editor but left the front end as it was.

#3 @up1512001
5 months ago

@sabernhardt updated PR as per your suggestion.

#4 @poena
5 months ago

Can you refresh the PR with the latest changes from trunk?

Also could the whole IE hack be moved? I don't think there are any reasons anymore to keep parts of it in the group block style?
I mean from

// Start IE clearfix

to

// End IE clearfix.

Until then, I have tested the change in the PR on top of 6.7 Alpha, where the inner div in the group block grid variation is removed.
Removing the .wp-block-group:after solves the problem (removing the :before does not seem to have any impact).

I do not see any side effects on other groups, but I did not test on any older WordPress versions.

Last edited 5 months ago by poena (previous) (diff)

#5 @up1512001
5 months ago

@poena I have updated the PR as per your suggestion.

#6 @poena
5 months ago

The commit removes the IE part, instead of moving it to ie.scss.

#7 @poena
5 months ago

  • Milestone changed from Future Release to 6.7

@karmatosed commented on PR #7001:


5 months ago
#8

@up1512001 this appears to have some merge conflicts. I am going to re-run tests but if this continues I will need you to check the PR here.

@up1512001 commented on PR #7001:


5 months ago
#9

@up1512001 this appears to have some merge conflicts. I am going to re-run tests but if this continues I will need you to check the PR here.

@karmatosed resolved merge conflicts.

#10 @karmatosed
5 months ago

Thank you @up1512001 I will now look at testing what we have and check that what @poena asked for has happened by moving things to ie.css.

#11 @karmatosed
5 months ago

  • Owner changed from up1512001 to karmatosed

#12 @karmatosed
5 months ago

Unless I am mistaken the latest patch doesn't do this recommendation by @sabernhardt and I am concerned of the implications there:

The front-end styles could keep display: flow-root in group/_style.scss for older versions of WordPress that do not set the flex or grid display.

#13 @karmatosed
5 months ago

  • Owner karmatosed deleted

#14 @up1512001
5 months ago

@karmatosed removing IE hack part was suggested by @poena.

#15 @karmatosed
5 months ago

@up1512001, further up https://core.trac.wordpress.org/ticket/61611#comment:2 @sabernhardt recommends some other changes to consider that haven't been considered and those are what I am referring to. Are you able to review those also? I am aware there was a lot of feedback to process perhaps and it might have been lost but I want to ensure it doesn't get missed.

This ticket was mentioned in Slack in #core-themes by karmatosed. View the logs.


5 months ago

#17 @up1512001
5 months ago

@karmatosed I will update the PR according to those suggestions.

#18 @karmatosed
4 months ago

  • Owner set to karmatosed

I think the patch has been updated so checking this out now.

#19 @karmatosed
4 months ago

  • Keywords needs-testing added; changes-requested removed

#20 @karmatosed
4 months ago

  • Keywords commit added

I can confirm in testing this works and now moving it to commit. Thank you everyone for working on this.

#21 @karmatosed
4 months ago

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

In 58853:

Twenty Twenty-One: Fixes float clearing elements being visible in Row and Grid blocks.

The grid layout looks different between front and back end due to the float clearing elements being visible in Row and Grid blocks. This moves the hack rather than deletes it.

Props up1512001, sabernhardt, poena.
Fixes #61611.

Note: See TracTickets for help on using tickets.