mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Editor: fix pattern alignment in editor view.
Adjusts root padding for synced patterns in the editor to avoid discrepancies with the front end view. Props aaronrobertshaw, mukesh27. Fixes #59359. git-svn-id: https://develop.svn.wordpress.org/trunk@56615 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2496,11 +2496,11 @@ class WP_Theme_JSON {
|
||||
// Right and left padding are applied to the first container with `.has-global-padding` class.
|
||||
$css .= '.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }';
|
||||
// Nested containers with `.has-global-padding` class do not get padding.
|
||||
$css .= '.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }';
|
||||
$css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }';
|
||||
// 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); }';
|
||||
// The above rule is negated for alignfull children of nested containers.
|
||||
$css .= '.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }';
|
||||
$css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }';
|
||||
// Some of the children of alignfull blocks without content width should also get padding: text blocks and non-alignfull container blocks.
|
||||
$css .= '.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }';
|
||||
// The above rule also has to be negated for blocks inside nested `.has-global-padding` blocks.
|
||||
|
||||
Reference in New Issue
Block a user