diff --git a/lib/full-site-editing/edit-site-page.php b/lib/full-site-editing/edit-site-page.php index 3418054f12b9a..076beff97f12d 100644 --- a/lib/full-site-editing/edit-site-page.php +++ b/lib/full-site-editing/edit-site-page.php @@ -165,16 +165,6 @@ static function( $classes ) { ) ); - add_action( - 'admin_head', - function() { - $filters = wp_get_global_styles_svg_filters(); - if ( ! empty( $filters ) ) { - printf( '', wp_json_encode( $filters ) ); - } - } - ); - wp_add_inline_script( 'wp-blocks', sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $post ) ) ), diff --git a/packages/block-editor/src/hooks/duotone.js b/packages/block-editor/src/hooks/duotone.js index 13de8f2a4d79a..dafd92020da37 100644 --- a/packages/block-editor/src/hooks/duotone.js +++ b/packages/block-editor/src/hooks/duotone.js @@ -60,82 +60,109 @@ export function getValuesFromColors( colors = [] ) { */ /** - * SVG and stylesheet needed for rendering the duotone filter. + * Stylesheet for rendering the duotone filter. * * @param {Object} props Duotone props. * @param {string} props.selector Selector to apply the filter to. * @param {string} props.id Unique id for this duotone filter. - * @param {Values} props.values R, G, B, and A values to filter with. * * @return {WPElement} Duotone element. */ -function DuotoneFilter( { selector, id, values } ) { - const stylesheet = ` +function DuotoneStylesheet( { selector, id } ) { + const css = ` ${ selector } { filter: url( #${ id } ); } `; + return ; +} +/** + * SVG for rendering the duotone filter. + * + * @param {Object} props Duotone props. + * @param {string} props.id Unique id for this duotone filter. + * @param {Values} props.values R, G, B, and A values to filter with. + * + * @return {WPElement} Duotone element. + */ +function DuotoneFilter( { id, values } ) { return ( - <> - - - - + + + + + - - - - - - - - - - -