Changeset 58226 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 05/29/2024 05:14:00 AM (22 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-theme-json.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r58222 r58226 2689 2689 * 2690 2690 * @since 6.1.0 2691 * @since 6.6.0 Use `ROOT_CSS_PROPERTIES_SELECTOR` for CSS custom properties .2691 * @since 6.6.0 Use `ROOT_CSS_PROPERTIES_SELECTOR` for CSS custom properties and improved consistency of root padding rules. 2692 2692 * 2693 2693 * @param string $selector The root node selector. … … 2709 2709 $wide_size = isset( $settings['layout']['wideSize'] ) ? $settings['layout']['wideSize'] : $settings['layout']['contentSize']; 2710 2710 $wide_size = static::is_safe_css_declaration( 'max-width', $wide_size ) ? $wide_size : 'initial'; 2711 $css .= static::ROOT_CSS_PROPERTIES_SELECTOR . ' { --wp--style--global--content-size: ' . $content_size . ';';2712 $css .= '--wp--style--global--wide-size: ' . $wide_size . '; }';2711 $css .= static::ROOT_CSS_PROPERTIES_SELECTOR . ' { --wp--style--global--content-size: ' . $content_size . ';'; 2712 $css .= '--wp--style--global--wide-size: ' . $wide_size . '; }'; 2713 2713 } 2714 2714 … … 2728 2728 // Right and left padding are applied to the first container with `.has-global-padding` class. 2729 2729 $css .= '.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }'; 2730 // Nested containers with `.has-global-padding` class do not get padding.2731 $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }';2732 2730 // Alignfull children of the container with left and right padding have negative margins so they can still be full width. 2733 2731 $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); }'; 2734 // The above rule is negated for alignfull children of nested containers. 2735 $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }'; 2736 // Some of the children of alignfull blocks without content width should also get padding: text blocks and non-alignfull container blocks. 2737 $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); }'; 2738 // The above rule also has to be negated for blocks inside nested `.has-global-padding` blocks. 2739 $css .= '.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0; }'; 2732 // Nested children of the container with left and right padding that are not wide or full aligned do not get padding. 2733 $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }'; 2734 // Nested children of the container with left and right padding that are not wide or full aligned do not get negative margin applied. 2735 $css .= '.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0; }'; 2740 2736 } 2741 2737
Note: See TracChangeset
for help on using the changeset viewer.