Prevent Mini-Cart template part preview in Site Editor being too high (https://github.com/woocommerce/woocommerce-blocks/pull/10204)

* Prevent Mini-Cart template part preview in Site Editor being too high

* Remove Mini-Cart Contents styles related to Style Book
This commit is contained in:
Albert Juhé Lluveras 2023-07-14 16:12:40 +02:00 committed by GitHub
parent a3ac0e2c62
commit 55a6e38598
2 changed files with 9 additions and 16 deletions

View File

@ -47,18 +47,7 @@ const Edit = ( {
}: Props ): ReactElement => {
const { currentView, width } = attributes;
const blockProps = useBlockProps( {
/**
* This is a workaround for the Site Editor to calculate the
* correct height of the Mini-Cart template part on the first load.
*
* @see https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/5825
*/
style: {
minHeight: '100vh',
width,
},
} );
const blockProps = useBlockProps();
const defaultTemplate = [
[ 'woocommerce/filled-mini-cart-contents-block', {}, [] ],

View File

@ -88,8 +88,12 @@
}
}
.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents,
.editor-styles-wrapper .wp-block-woocommerce-filled-mini-cart-contents-block {
height: auto;
min-height: 500px;
/* Site Editor preview */
.block-editor-block-preview__content-iframe .editor-styles-wrapper {
.wp-block-woocommerce-mini-cart-contents,
.wp-block-woocommerce-filled-mini-cart-contents-block,
.wp-block-woocommerce-empty-mini-cart-contents-block {
height: 800px;
min-height: none;
}
}