From 43b4079e2b7b23fc13ad484732826ce7635409f0 Mon Sep 17 00:00:00 2001 From: isabel_brison Date: Thu, 20 Jun 2024 08:03:14 +0000 Subject: [PATCH] Editor: fix root padding for children of alignfull flow layouts. Updates the root padding CSS selectors so direct children of full width container blocks with flow layout receive padding. Props isabel_brison, aaronrobertshaw. Fixes #61464. Built from https://develop.svn.wordpress.org/trunk@58444 git-svn-id: http://core.svn.wordpress.org/trunk@57893 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme-json.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index d01ce6e8b2..311705b9ad 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -2900,10 +2900,10 @@ class WP_Theme_JSON { $css .= '.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }'; // Alignfull children of the container with left and right padding have negative margins so they can still be full width. $css .= '.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }'; - // Nested children of the container with left and right padding that are not wide or full aligned do not get padding. - $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }'; - // Nested children of the container with left and right padding that are not wide or full aligned do not get negative margin applied. - $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0; }'; + // Nested children of the container with left and right padding that are not wide or full aligned do not get padding, unless they are direct children of an alignfull flow container. + $css .= '.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }'; + // Alignfull direct children of the containers that are targeted by the rule above do not need negative margins. + $css .= '.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0; }'; } $css .= '.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }'; diff --git a/wp-includes/version.php b/wp-includes/version.php index 593ff9a884..d5c8ce5e06 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-beta3-58443'; +$wp_version = '6.6-beta3-58444'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.