diff --git a/assets/js/atomic/blocks/product-elements/title/block.tsx b/assets/js/atomic/blocks/product-elements/title/block.tsx index 01f1e17a57f..5fab89b1aaf 100644 --- a/assets/js/atomic/blocks/product-elements/title/block.tsx +++ b/assets/js/atomic/blocks/product-elements/title/block.tsx @@ -3,7 +3,10 @@ */ import classnames from 'classnames'; import { HTMLAttributes } from 'react'; -import { useProductDataContext } from '@woocommerce/shared-context'; +import { + useInnerBlockLayoutContext, + useProductDataContext, +} from '@woocommerce/shared-context'; import { isFeaturePluginBuild } from '@woocommerce/block-settings'; import { withProductDataContext } from '@woocommerce/shared-hocs'; import ProductName from '@woocommerce/base-components/product-name'; @@ -58,6 +61,7 @@ export const Block = ( props: Props ): JSX.Element => { align, } = props; + const { parentClassName } = useInnerBlockLayoutContext(); const { product } = useProductDataContext(); const { dispatchStoreEvent } = useStoreEvents(); @@ -74,6 +78,7 @@ export const Block = ( props: Props ): JSX.Element => { colorProps.className, 'wc-block-components-product-title', { + [ `${ parentClassName }__product-title` ]: parentClassName, [ `wc-block-components-product-title--align-${ align }` ]: align && isFeaturePluginBuild(), } @@ -99,6 +104,7 @@ export const Block = ( props: Props ): JSX.Element => { colorProps.className, 'wc-block-components-product-title', { + [ `${ parentClassName }__product-title` ]: parentClassName, [ `wc-block-components-product-title--align-${ align }` ]: align && isFeaturePluginBuild(), } diff --git a/assets/js/atomic/blocks/product-elements/title/editor.scss b/assets/js/atomic/blocks/product-elements/title/editor.scss index faeb1645153..8129e7bb40c 100644 --- a/assets/js/atomic/blocks/product-elements/title/editor.scss +++ b/assets/js/atomic/blocks/product-elements/title/editor.scss @@ -1,3 +1,13 @@ .editor-styles-wrapper a.wc-block-components-product-name { color: inherit; } + +.editor-styles-wrapper .wc-block-components-product-title { + margin-top: 0; + margin-bottom: $gap-small; + line-height: 1.5; + font-weight: 700; + padding: 0; + display: block; + font-size: inherit; +}