From 17784e93761be6fe2754198436e086d8c574ead0 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Thu, 22 Aug 2024 08:15:51 +0700 Subject: [PATCH] refactor --- .../mui-material/src/styles/createThemeWithVars.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/mui-material/src/styles/createThemeWithVars.js b/packages/mui-material/src/styles/createThemeWithVars.js index cd72c464595b1c..026f1b9e6ede5d 100644 --- a/packages/mui-material/src/styles/createThemeWithVars.js +++ b/packages/mui-material/src/styles/createThemeWithVars.js @@ -64,13 +64,11 @@ function getSpacingVal(spacingInput) { if (typeof spacingInput === 'number') { return `${spacingInput}px`; } - if (typeof spacingInput === 'string') { - return spacingInput; - } - if (typeof spacingInput === 'function') { - return spacingInput; - } - if (Array.isArray(spacingInput)) { + if ( + typeof spacingInput === 'string' || + typeof spacingInput === 'function' || + Array.isArray(spacingInput) + ) { return spacingInput; } return '8px';