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:
parent
a3ac0e2c62
commit
55a6e38598
|
@ -47,18 +47,7 @@ const Edit = ( {
|
||||||
}: Props ): ReactElement => {
|
}: Props ): ReactElement => {
|
||||||
const { currentView, width } = attributes;
|
const { currentView, width } = attributes;
|
||||||
|
|
||||||
const blockProps = useBlockProps( {
|
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 defaultTemplate = [
|
const defaultTemplate = [
|
||||||
[ 'woocommerce/filled-mini-cart-contents-block', {}, [] ],
|
[ 'woocommerce/filled-mini-cart-contents-block', {}, [] ],
|
||||||
|
|
|
@ -88,8 +88,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-styles-wrapper .wp-block-woocommerce-mini-cart-contents,
|
/* Site Editor preview */
|
||||||
.editor-styles-wrapper .wp-block-woocommerce-filled-mini-cart-contents-block {
|
.block-editor-block-preview__content-iframe .editor-styles-wrapper {
|
||||||
height: auto;
|
.wp-block-woocommerce-mini-cart-contents,
|
||||||
min-height: 500px;
|
.wp-block-woocommerce-filled-mini-cart-contents-block,
|
||||||
|
.wp-block-woocommerce-empty-mini-cart-contents-block {
|
||||||
|
height: 800px;
|
||||||
|
min-height: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue