@@ -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
@@ -124,11 +130,14 @@ export const deprecateTypographyFontSize = {
124130 const getAttrName = getAttrNameFunction ( attrNameTemplate )
125131 const getAttribute = _attrName => attributes [ getAttrName ( _attrName ) ]
126132
127- const fontSize = getAttribute ( 'fontSize' )
128-
129133 const newAttributes = {
130134 ...attributes ,
131- [ getAttrName ( 'fontSize' ) ] : String ( fontSize ) ,
135+ }
136+
137+ const fontSize = getAttribute ( 'fontSize' )
138+
139+ if ( typeof fontSize === 'number' ) {
140+ newAttributes [ getAttrName ( 'fontSize' ) ] = String ( fontSize )
132141 }
133142
134143 return newAttributes
0 commit comments