Skip to content

Commit

Permalink
Let the style engine take care of margin: 0 on the body
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Jun 6, 2022
1 parent af4a9ff commit d90553f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ protected function get_block_classes( $style_nodes ) {
* @link https://github.com/WordPress/gutenberg/issues/36147.
*/
if ( static::ROOT_BLOCK_SELECTOR === $selector ) {
$block_rules .= "body { margin: 0; }\n";
$node['spacing']['margin'] = '0px';

}

// 2. Generate the rules that use the general selector.
Expand All @@ -301,6 +302,7 @@ protected function get_block_classes( $style_nodes ) {
'prettify' => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG,
)
);

if ( isset( $styles['css'] ) ) {
$block_rules .= $styles['css'];
}
Expand Down

0 comments on commit d90553f

Please sign in to comment.