Make WordPress Core

Changeset 55956


Ignore:
Timestamp:
06/21/2023 05:30:24 AM (13 months ago)
Author:
isabel_brison
Message:

Editor: update layout classnames and specificity.

Adds a compound layout classname and reduces layout spacing rule specificity.

Props ramonopoly, andrewserong, poena.
Fixes #58548.

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/layout.php

    r55541 r55956  
    313313 *
    314314 * @since 5.8.0
     315 * @since 6.3.0 Adds compound class to layout wrapper for global spacing styles.
    315316 * @access private
    316317 *
     
    474475        }
    475476    }
     477
     478    // Add combined layout and block classname for global styles to hook onto.
     479    $block_name    = explode( '/', $block['blockName'] );
     480    $class_names[] = 'wp-block-' . end( $block_name ) . '-' . $layout_classname;
    476481
    477482    $content_with_outer_classnames = '';
  • trunk/src/wp-includes/class-wp-theme-json.php

    r55950 r55956  
    12471247     *
    12481248     * @since 6.1.0
     1249     * @since 6.3.0 Reduced specificity for layout margin rules.
    12491250     *
    12501251     * @param array $block_metadata Metadata about the block to get styles for.
     
    13431344                                    );
    13441345                                } else {
    1345                                     $format          = static::ROOT_BLOCK_SELECTOR === $selector ? '%s .%s%s' : '%s.%s%s';
     1346                                    $format          = static::ROOT_BLOCK_SELECTOR === $selector ? ':where(%s .%s) %s' : '%s-%s%s';
    13461347                                    $layout_selector = sprintf(
    13471348                                        $format,
     
    25612562        if ( $has_block_gap_support ) {
    25622563            $block_gap_value = static::get_property_value( $this->theme_json, array( 'styles', 'spacing', 'blockGap' ) );
    2563             $css            .= '.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }';
    2564             $css            .= ".wp-site-blocks > * + * { margin-block-start: $block_gap_value; }";
     2564            $css            .= ":where(.wp-site-blocks) > * { margin-block-start: $block_gap_value; margin-block-end: 0; }";
     2565            $css            .= ':where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }';
     2566            $css            .= ':where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }';
    25652567
    25662568            // For backwards compatibility, ensure the legacy block gap CSS variable is still available.
  • trunk/src/wp-includes/theme.json

    r55405 r55956  
    220220                    "spacingStyles": [
    221221                        {
     222                            "selector": " > :first-child:first-child",
     223                            "rules": {
     224                                "margin-block-start": "0"
     225                            }
     226                        },
     227                        {
     228                            "selector": " > :last-child:last-child",
     229                            "rules": {
     230                                "margin-block-end": "0"
     231                            }
     232                        },
     233                        {
    222234                            "selector": " > *",
    223                             "rules": {
    224                                 "margin-block-start": "0",
    225                                 "margin-block-end": "0"
    226                             }
    227                         },
    228                         {
    229                             "selector": " > * + *",
    230235                            "rules": {
    231236                                "margin-block-start": null,
     
    280285                    "spacingStyles": [
    281286                        {
     287                            "selector": " > :first-child:first-child",
     288                            "rules": {
     289                                "margin-block-start": "0"
     290                            }
     291                        },
     292                        {
     293                            "selector": " > :last-child:last-child",
     294                            "rules": {
     295                                "margin-block-end": "0"
     296                            }
     297                        },
     298                        {
    282299                            "selector": " > *",
    283                             "rules": {
    284                                 "margin-block-start": "0",
    285                                 "margin-block-end": "0"
    286                             }
    287                         },
    288                         {
    289                             "selector": " > * + *",
    290300                            "rules": {
    291301                                "margin-block-start": null,
  • trunk/tests/phpunit/data/blocks/fixtures/core__column.server.html

    r55282 r55956  
    11
    2 <div class="wp-block-column is-layout-flow">
     2<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
    33   
    44    <p>Column One, Paragraph One</p>
  • trunk/tests/phpunit/data/blocks/fixtures/core__columns.server.html

    r55282 r55956  
    11
    2 <div class="wp-block-columns has-3-columns is-layout-flex wp-container-1">
     2<div class="wp-block-columns has-3-columns is-layout-flex wp-container-1 wp-block-columns-is-layout-flex">
    33   
    4     <div class="wp-block-column is-layout-flow">
     4    <div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
    55       
    66        <p>Column One, Paragraph One</p>
     
    1212   
    1313   
    14     <div class="wp-block-column is-layout-flow">
     14    <div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
    1515       
    1616        <p>Column Two, Paragraph One</p>
  • trunk/tests/phpunit/data/blocks/fixtures/core__columns__deprecated.server.html

    r55282 r55956  
    11
    2 <div class="wp-block-columns has-3-columns is-layout-flex wp-container-1">
     2<div class="wp-block-columns has-3-columns is-layout-flex wp-container-1 wp-block-columns-is-layout-flex">
    33   
    44    <p class="layout-column-1">Column One, Paragraph One</p>
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery-with-caption.server.html

    r55471 r55956  
    11
    22<figure
    3     class="wp-block-gallery has-nested-images columns-default is-cropped columns-2 wp-block-gallery-1 is-layout-flex"
     3    class="wp-block-gallery has-nested-images columns-default is-cropped columns-2 wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"
    44>
    55
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery.server.html

    r55471 r55956  
    11
    22<figure
    3     class="wp-block-gallery has-nested-images columns-default is-cropped columns-2 wp-block-gallery-1 is-layout-flex"
     3    class="wp-block-gallery has-nested-images columns-default is-cropped columns-2 wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"
    44>
    55
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__columns.server.html

    r55471 r55956  
    11
    2 <figure class="wp-block-gallery has-nested-images columns-1 is-cropped wp-block-gallery-1 is-layout-flex">
     2<figure class="wp-block-gallery has-nested-images columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33    <figure class="wp-block-image size-large">
    44        <img data-id="1421"
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__deprecated-1.server.html

    r55471 r55956  
    11
    2 <div class="wp-block-gallery columns-2 is-cropped alignwide wp-block-gallery-1 is-layout-flex">
     2<div class="wp-block-gallery columns-2 is-cropped alignwide wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33    <figure class="blocks-gallery-image">
    44        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==" alt="title" />
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__deprecated-2.server.html

    r55471 r55956  
    11
    2 <ul class="wp-block-gallery columns-2 is-cropped alignwide wp-block-gallery-1 is-layout-flex">
     2<ul class="wp-block-gallery columns-2 is-cropped alignwide wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33    <li class="blocks-gallery-item">
    44        <figure>
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__deprecated-3.server.html

    r55471 r55956  
    11
    2 <ul class="wp-block-gallery columns-2 is-cropped alignwide wp-block-gallery-1 is-layout-flex">
     2<ul class="wp-block-gallery columns-2 is-cropped alignwide wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33    <li class="blocks-gallery-item">
    44        <figure>
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__deprecated-4.server.html

    r55471 r55956  
    11
    2 <figure class="wp-block-gallery columns-3 is-cropped alignwide wp-block-gallery-1 is-layout-flex">
     2<figure class="wp-block-gallery columns-3 is-cropped alignwide wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33    <ul class="blocks-gallery-grid">
    44        <li class="blocks-gallery-item">
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__deprecated-5.server.html

    r55471 r55956  
    11
    2 <figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex">
     2<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33    <ul class="blocks-gallery-grid">
    44        <li class="blocks-gallery-item">
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__deprecated-6.server.html

    r55471 r55956  
    11
    2 <figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex">
     2<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33    <ul class="blocks-gallery-grid">
    44        <li class="blocks-gallery-item">
  • trunk/tests/phpunit/data/blocks/fixtures/core__gallery__deprecated-7.server.html

    r55471 r55956  
    11
    2 <figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex">
     2<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    33        <figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg"><img data-id="705"  src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg" alt="" class="wp-image-705"/></a></figure>
    44        <figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg"><img data-id="704"  src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg" alt="" class="wp-image-704"/></a></figure>
     
    77
    88
    9 <figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex">
     9<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
    1010    <figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg"><img data-id="705"  src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg" alt="" class="wp-image-705"/></a></figure>
    1111    <figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg"><img data-id="704"  src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg" alt="" class="wp-image-704"/></a></figure>
  • trunk/tests/phpunit/tests/block-supports/layout.php

    r55457 r55956  
    171171    /**
    172172     * @ticket 57584
     173     * @ticket 58548
    173174     *
    174175     * @dataProvider data_layout_support_flag_renders_classnames_on_wrapper
     
    208209                    ),
    209210                ),
    210                 'expected_output' => '<div class="wp-block-group is-layout-flow"></div>',
     211                'expected_output' => '<div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"></div>',
    211212            ),
    212213            'single wrapper block layout with constrained type' => array(
     
    227228                    ),
    228229                ),
    229                 'expected_output' => '<div class="wp-block-group is-layout-constrained"></div>',
     230                'expected_output' => '<div class="wp-block-group is-layout-constrained wp-block-group-is-layout-constrained"></div>',
    230231            ),
    231232            'multiple wrapper block layout with flow type' => array(
     
    248249                    ),
    249250                ),
    250                 'expected_output' => '<div class="wp-block-group"><div class="wp-block-group__inner-wrapper is-layout-flow"></div></div>',
     251                'expected_output' => '<div class="wp-block-group"><div class="wp-block-group__inner-wrapper is-layout-flow wp-block-group-is-layout-flow"></div></div>',
    251252            ),
    252253        );
  • trunk/tests/phpunit/tests/media.php

    r55850 r55956  
    38283828     *
    38293829     * @ticket 56930
     3830     * @ticket 58548
    38303831     *
    38313832     * @covers ::wp_filter_content_tags
     
    38643865
    38653866        $html = get_the_block_template_html();
    3866         $this->assertSame( '<div class="wp-site-blocks"><div class="entry-content wp-block-post-content is-layout-flow">' . $expected_content . '</div></div>', $html );
     3867        $this->assertSame( '<div class="wp-site-blocks"><div class="entry-content wp-block-post-content is-layout-flow wp-block-post-content-is-layout-flow">' . $expected_content . '</div></div>', $html );
    38673868    }
    38683869
     
    38723873     *
    38733874     * @ticket 56930
     3875     * @ticket 58548
    38743876     *
    38753877     * @covers ::wp_filter_content_tags
     
    39193921
    39203922        $html = get_the_block_template_html();
    3921         $this->assertSame( '<div class="wp-site-blocks">' . $expected_featured_image . ' <div class="entry-content wp-block-post-content is-layout-flow">' . $expected_content . '</div></div>', $html );
     3923        $this->assertSame( '<div class="wp-site-blocks">' . $expected_featured_image . ' <div class="entry-content wp-block-post-content is-layout-flow wp-block-post-content-is-layout-flow">' . $expected_content . '</div></div>', $html );
    39223924    }
    39233925
  • trunk/tests/phpunit/tests/theme/wpThemeJson.php

    r55912 r55956  
    449449    /**
    450450     * @ticket 54336
     451     * @ticket 58548
    451452     */
    452453    public function test_get_stylesheet_renders_enabled_protected_properties() {
     
    467468        );
    468469
    469         $expected = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: 1em; }body { --wp--style--block-gap: 1em; }';
     470        $expected = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }:where(.wp-site-blocks) > * { margin-block-start: 1em; margin-block-end: 0; }:where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }:where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }body { --wp--style--block-gap: 1em; }';
    470471        $this->assertSame( $expected, $theme_json->get_stylesheet() );
    471472        $this->assertSame( $expected, $theme_json->get_stylesheet( array( 'styles' ) ) );
     
    33003301     *
    33013302     * @ticket 56467
     3303     * @ticket 58548
    33023304     *
    33033305     * @param array $layout_definitions Layout definitions as stored in core theme.json.
     
    33263328        // Results also include root site blocks styles.
    33273329        $this->assertSame(
    3328             'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: 1em; }body { --wp--style--block-gap: 1em; }body .is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}body .is-layout-flow > * + *{margin-block-start: 1em;margin-block-end: 0;}body .is-layout-flex{gap: 1em;}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}',
     3330            'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }:where(.wp-site-blocks) > * { margin-block-start: 1em; margin-block-end: 0; }:where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }:where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }body { --wp--style--block-gap: 1em; }:where(body .is-layout-flow)  > *{margin-block-start: 0;margin-block-end: 0;}:where(body .is-layout-flow)  > * + *{margin-block-start: 1em;margin-block-end: 0;}:where(body .is-layout-flex) {gap: 1em;}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}',
    33293331            $theme_json->get_stylesheet( array( 'styles' ) )
    33303332        );
     
    33353337     *
    33363338     * @ticket 56467
     3339     * @ticket 58548
    33373340     *
    33383341     * @param array $layout_definitions Layout definitions as stored in core theme.json.
     
    33613364        // Results also include root site blocks styles.
    33623365        $this->assertSame(
    3363             'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: var(--wp--preset--spacing--60); }body { --wp--style--block-gap: var(--wp--preset--spacing--60); }body .is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}body .is-layout-flow > * + *{margin-block-start: var(--wp--preset--spacing--60);margin-block-end: 0;}body .is-layout-flex{gap: var(--wp--preset--spacing--60);}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}',
     3366            'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }:where(.wp-site-blocks) > * { margin-block-start: var(--wp--preset--spacing--60); margin-block-end: 0; }:where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }:where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }body { --wp--style--block-gap: var(--wp--preset--spacing--60); }:where(body .is-layout-flow)  > *{margin-block-start: 0;margin-block-end: 0;}:where(body .is-layout-flow)  > * + *{margin-block-start: var(--wp--preset--spacing--60);margin-block-end: 0;}:where(body .is-layout-flex) {gap: var(--wp--preset--spacing--60);}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}',
    33643367            $theme_json->get_stylesheet( array( 'styles' ) )
    33653368        );
     
    35173520
    35183521        $this->assertSame(
    3519             'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: 1rem; }body { --wp--style--block-gap: 1rem; }body .is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}body .is-layout-flow > * + *{margin-block-start: 1rem;margin-block-end: 0;}body .is-layout-flex{gap: 1rem;}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}.wp-block-post-content{color: gray;}.wp-block-social-links.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flex{gap: 0;}.wp-block-buttons.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flex{gap: 0;}',
     3522            'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }:where(.wp-site-blocks) > * { margin-block-start: 1rem; margin-block-end: 0; }:where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }:where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }body { --wp--style--block-gap: 1rem; }:where(body .is-layout-flow)  > *{margin-block-start: 0;margin-block-end: 0;}:where(body .is-layout-flow)  > * + *{margin-block-start: 1rem;margin-block-end: 0;}:where(body .is-layout-flex) {gap: 1rem;}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}.wp-block-post-content{color: gray;}.wp-block-social-links-is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links-is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links-is-layout-flex{gap: 0;}.wp-block-buttons-is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons-is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons-is-layout-flex{gap: 0;}',
    35203523            $theme_json->get_stylesheet()
    35213524        );
     
    39593962    /**
    39603963     * @ticket 56611
     3964     * @ticket 58548
    39613965     */
    39623966    public function test_get_styles_with_appearance_tools() {
     
    39753979        );
    39763980
    3977         $expected   = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: ; }body { --wp--style--block-gap: ; }';
     3981        $expected   = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }:where(.wp-site-blocks) > * { margin-block-start: ; margin-block-end: 0; }:where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }:where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }body { --wp--style--block-gap: ; }';
    39783982        $root_rules = $theme_json->get_root_layout_rules( WP_Theme_JSON::ROOT_BLOCK_SELECTOR, $metadata );
    39793983        $this->assertSame( $expected, $root_rules );
Note: See TracChangeset for help on using the changeset viewer.