@@ -211,8 +211,14 @@ export const addStyles = ( blockStyleGenerator, props = {} ) => {
211211 styleRule : 'columnGap' ,
212212 attrName : 'innerBlockColumnGap' ,
213213 key : 'innerBlockColumnGapEdit' ,
214- format : `%spx` ,
215214 responsive : 'all' ,
215+ valueCallback : value => {
216+ // Substitute with using format to work with preset controls
217+ if ( typeof value === 'string' && value . startsWith ( 'var' ) ) {
218+ return value
219+ }
220+ return value + 'px'
221+ } ,
216222 enabledCallback : getAttribute => getAttribute ( 'innerBlockOrientation' ) === 'horizontal' ,
217223 dependencies : [
218224 'innerBlockOrientation' ,
@@ -225,8 +231,14 @@ export const addStyles = ( blockStyleGenerator, props = {} ) => {
225231 styleRule : 'columnGap' ,
226232 attrName : 'innerBlockColumnGap' ,
227233 key : 'innerBlockColumnGapSave' ,
228- format : `%spx` ,
229234 responsive : 'all' ,
235+ valueCallback : value => {
236+ // Substitute with using format to work with preset controls
237+ if ( typeof value === 'string' && value . startsWith ( 'var' ) ) {
238+ return value
239+ }
240+ return value + 'px'
241+ } ,
230242 enabledCallback : getAttribute => getAttribute ( 'innerBlockOrientation' ) === 'horizontal' ,
231243 dependencies : [
232244 'innerBlockOrientation' ,
@@ -241,12 +253,18 @@ export const addStyles = ( blockStyleGenerator, props = {} ) => {
241253 styleRule : 'rowGap' ,
242254 attrName : 'innerBlockRowGap' ,
243255 key : 'innerBlockRowGapEdit' ,
244- format : `%spx` ,
245256 responsive : 'all' ,
246257 enabledCallback : getAttribute => {
247258 return getAttribute ( 'innerBlockOrientation' ) !== 'horizontal' ||
248259 ( getAttribute ( 'innerBlockOrientation' ) === 'horizontal' && getAttribute ( 'innerBlockWrap' ) === 'wrap' )
249260 } ,
261+ valueCallback : value => {
262+ // Substitute with using format to work with preset controls
263+ if ( typeof value === 'string' && value . startsWith ( 'var' ) ) {
264+ return value
265+ }
266+ return value + 'px'
267+ } ,
250268 dependencies : [
251269 'innerBlockOrientation' ,
252270 'innerBlockWrap' ,
@@ -259,8 +277,14 @@ export const addStyles = ( blockStyleGenerator, props = {} ) => {
259277 styleRule : 'rowGap' ,
260278 attrName : 'innerBlockRowGap' ,
261279 key : 'innerBlockRowGapSave' ,
262- format : `%spx` ,
263280 responsive : 'all' ,
281+ valueCallback : value => {
282+ // Substitute with using format to work with preset controls
283+ if ( typeof value === 'string' && value . startsWith ( 'var' ) ) {
284+ return value
285+ }
286+ return value + 'px'
287+ } ,
264288 enabledCallback : getAttribute => {
265289 return getAttribute ( 'innerBlockOrientation' ) !== 'horizontal' ||
266290 ( getAttribute ( 'innerBlockOrientation' ) === 'horizontal' && getAttribute ( 'innerBlockWrap' ) === 'wrap' )
0 commit comments