Widgets: Add editor styles to the widgets block editor.

This updates the widgets screen to load the editor styles in the same way as the post editor. This combined with the package updates in [51198] and [51199] ensures that the blocks added to sidebars more accurately reflect what will be displayed on the front end of the site.

Props isabel_brison, noisysocks, andraganescu, audrasjb, jorbin, caseymilne, desrosj.
Fixes #53344. See #53388.

git-svn-id: https://develop.svn.wordpress.org/trunk@51200 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2021-06-22 13:32:42 +00:00
parent b668efd6ff
commit 31adfecbf3
4 changed files with 63 additions and 34 deletions

View File

@@ -429,4 +429,19 @@ class WP_Test_Block_Editor extends WP_UnitTestCase {
$this->assertContains( '"\/wp\/v2\/blocks"', $after );
$this->assertContains( '"\/wp\/v2\/types"', $after );
}
/**
* @ticket 53344
*/
function test_get_block_editor_theme_styles() {
$theme_styles = get_block_editor_theme_styles();
$this->assertCount( 1, $theme_styles );
$this->assertSameSets(
array(
'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
'__unstableType' => 'core',
),
$theme_styles[0]
);
}
}