Make WordPress Core


Ignore:
Timestamp:
09/19/2023 01:43:07 AM (15 months ago)
Author:
isabel_brison
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r56614 r56615  
    24972497            $css .= '.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }';
    24982498            // Nested containers with `.has-global-padding` class do not get padding.
    2499             $css .= '.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }';
     2499            $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }';
    25002500            // Alignfull children of the container with left and right padding have negative margins so they can still be full width.
    25012501            $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); }';
    25022502            // The above rule is negated for alignfull children of nested containers.
    2503             $css .= '.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }';
     2503            $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }';
    25042504            // Some of the children of alignfull blocks without content width should also get padding: text blocks and non-alignfull container blocks.
    25052505            $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); }';
Note: See TracChangeset for help on using the changeset viewer.