File tree Expand file tree Collapse file tree
src/block-components/typography Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,8 +58,14 @@ export const deprecateTypographyGradientColor = {
5858 if ( getAttribute ( 'textColorType' ) === 'gradient' && getAttribute ( 'textColor2' ) ) {
5959 const textColor1 = getAttribute ( 'textColor1' ) || getAttribute ( 'textColor2' )
6060 const textColor2 = getAttribute ( 'textColor2' ) || getAttribute ( 'textColor1' )
61- const textGradientDirection = getAttribute ( 'textGradientDirection' ) || getAttribute ( 'textGradientDirection' ) === 0 ? getAttribute ( 'textGradientDirection' ) : 180
62- newAttributes [ getAttrName ( 'textColor1' ) ] = `linear-gradient(${ textGradientDirection } deg, ${ textColor1 } 0%, ${ textColor2 } 100%)`
61+
62+ const isTextColor1Gradient = textColor1 && textColor1 . includes ( '-gradient' )
63+ const isTextColor2Gradient = textColor2 && textColor2 . includes ( '-gradient' )
64+
65+ if ( ! isTextColor1Gradient && ! isTextColor2Gradient ) {
66+ const textGradientDirection = getAttribute ( 'textGradientDirection' ) || getAttribute ( 'textGradientDirection' ) === 0 ? getAttribute ( 'textGradientDirection' ) : 180
67+ newAttributes [ getAttrName ( 'textColor1' ) ] = `linear-gradient(${ textGradientDirection } deg, ${ textColor1 } 0%, ${ textColor2 } 100%)`
68+ }
6369 }
6470
6571 return newAttributes
You can’t perform that action at this time.
0 commit comments