File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/block-components/typography Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,14 @@ export const deprecateTypographyGradientColor = {
58
58
if ( getAttribute ( 'textColorType' ) === 'gradient' && getAttribute ( 'textColor2' ) ) {
59
59
const textColor1 = getAttribute ( 'textColor1' ) || getAttribute ( 'textColor2' )
60
60
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
+ }
63
69
}
64
70
65
71
return newAttributes
You can’t perform that action at this time.
0 commit comments