Changeset 52329 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 12/06/2021 10:40:45 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r52321 r52329 356 356 * @since 5.8.0 357 357 * 358 * @param array $theme_json A structure that follows the theme.json schema.359 * @param string $origin Optional. What source of data this object represents.360 * One of 'default', 'theme', or 'custom'. Default 'theme'.358 * @param array $theme_json A structure that follows the theme.json schema. 359 * @param string $origin Optional. What source of data this object represents. 360 * One of 'default', 'theme', or 'custom'. Default 'theme'. 361 361 */ 362 362 public function __construct( $theme_json = array(), $origin = 'theme' ) { … … 777 777 } 778 778 779 /* 780 * Reset default browser margin on the root body element. 781 * This is set on the root selector **before** generating the ruleset 782 * from the `theme.json`. This is to ensure that if the `theme.json` declares 783 * `margin` in its `spacing` declaration for the `body` element then these 784 * user-generated values take precedence in the CSS cascade. 785 * @link https://github.com/WordPress/gutenberg/issues/36147. 786 */ 787 if ( self::ROOT_BLOCK_SELECTOR === $selector ) { 788 $block_rules .= 'body { margin: 0; }'; 789 } 790 779 791 // 2. Generate the rules that use the general selector. 780 792 $block_rules .= self::to_ruleset( $selector, $declarations ); … … 787 799 788 800 if ( self::ROOT_BLOCK_SELECTOR === $selector ) { 789 $block_rules .= 'body { margin: 0; }';790 801 $block_rules .= '.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }'; 791 802 $block_rules .= '.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';
Note: See TracChangeset
for help on using the changeset viewer.