From 199532b281a00a84e4d8859465a976c61f552135 Mon Sep 17 00:00:00 2001 From: Siddharth Kshetrapal Date: Mon, 11 May 2020 23:10:50 +0200 Subject: [PATCH] handle 0 for margin values (#79) --- packages/react-ui/src/primitives/element.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-ui/src/primitives/element.js b/packages/react-ui/src/primitives/element.js index c81c807..bc2921c 100644 --- a/packages/react-ui/src/primitives/element.js +++ b/packages/react-ui/src/primitives/element.js @@ -96,9 +96,9 @@ function Element( const margins = { margin: 0 } // because of the above reset, we have to manually handle overrides marginProps.map(m => { - if (props[m]) margins[m] = props[m] - if (themeStyles[m]) margins[m] = themeStyles[m] - if (css[m]) margins[m] = css[m] + if (typeof themeStyles[m] !== 'undefined') margins[m] = themeStyles[m] + if (typeof css[m] !== 'undefined') margins[m] = css[m] + if (typeof props[m] !== 'undefined') margins[m] = props[m] delete props[m] delete themeStyles[m] delete css[m]