Editor: Fix root padding for alignwide blocks.

Updates the root padding CSS selectors so wide width container blocks with constrained layout don’t receive padding.

Reviewed by audrasjb.
Merges [58685] to the 6.6 branch.

Props isabel_brison, mukesh27, aaronrobertshaw, hellofromTonya.
Fixes #61587.
Built from https://develop.svn.wordpress.org/branches/6.6@58696


git-svn-id: http://core.svn.wordpress.org/branches/6.6@58098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
davidbaumwald 2024-07-09 15:33:17 +00:00
parent 1851213287
commit 14e9ba9312
2 changed files with 4 additions and 4 deletions

View File

@ -2962,10 +2962,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, 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; }';
// Nested children of the container with left and right padding that are not 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)) { 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 .= '.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0; }';
}
$css .= '.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-RC2-58695';
$wp_version = '6.6-RC2-58696';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.