Add border attributes to featured items block to show border styles in editor (https://github.com/woocommerce/woocommerce-blocks/pull/8304)

This commit is contained in:
Roy Ho 2023-01-27 12:29:39 -08:00 committed by GitHub
parent f695b92c1f
commit 44f04c1cd1
1 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,7 @@ export interface FeaturedItemRequiredAttributes {
overlayGradient: string; overlayGradient: string;
showDesc: boolean; showDesc: boolean;
showPrice: boolean; showPrice: boolean;
borderColor: string;
} }
interface FeaturedCategoryRequiredAttributes interface FeaturedCategoryRequiredAttributes
@ -171,6 +172,7 @@ export const withFeaturedItem =
showPrice, showPrice,
style, style,
textColor, textColor,
borderColor,
} = attributes; } = attributes;
const classes = classnames( const classes = classnames(
@ -194,6 +196,11 @@ export const withFeaturedItem =
color: textColor color: textColor
? `var(--wp--preset--color--${ textColor })` ? `var(--wp--preset--color--${ textColor })`
: style?.color?.text, : style?.color?.text,
borderColor: borderColor
? `var(--wp--preset--color--${ borderColor })`
: 'transparent',
borderWidth: style?.border?.width,
boxSizing: 'border-box',
}; };
const wrapperStyle = { const wrapperStyle = {