Restore correct font style when the block is loaded in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/5600)
* Restore correct font style when the block is loaded in the editor Restore correct font style when the block is loaded in the editor * fix style on Twenty Twenty theme
This commit is contained in:
parent
8c7db9b875
commit
dd36c00180
|
@ -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(),
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue