From b46291d8366f517706cb0c8e5af2ed44b4706858 Mon Sep 17 00:00:00 2001 From: strozw Date: Mon, 17 Jan 2022 19:19:24 +0900 Subject: [PATCH] Fixed `ColProps` and, `col` props implementation when `false` are passed. --- packages/system/src/styles/flexbox-grids.test.ts | 2 ++ packages/system/src/styles/flexbox-grids.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/system/src/styles/flexbox-grids.test.ts b/packages/system/src/styles/flexbox-grids.test.ts index 190e091a..eb941d88 100644 --- a/packages/system/src/styles/flexbox-grids.test.ts +++ b/packages/system/src/styles/flexbox-grids.test.ts @@ -48,6 +48,8 @@ describe('#flexboxGrids', () => { flex: '0 0 33.3333%', }) + expect(flexboxGrids({ col: false })).toEqual({}) + expect(flexboxGrids({ col: true })).toEqual({ boxSizing: 'border-box', flexBasis: 0, diff --git a/packages/system/src/styles/flexbox-grids.ts b/packages/system/src/styles/flexbox-grids.ts index 8c342390..3be6a125 100644 --- a/packages/system/src/styles/flexbox-grids.ts +++ b/packages/system/src/styles/flexbox-grids.ts @@ -47,7 +47,7 @@ const getColStyle = ( } export interface ColProps { - col?: SystemProp + col?: SystemProp } export const col = createStyleGenerator({ getStyle: (props) => { @@ -59,6 +59,10 @@ export const col = createStyleGenerator({ maxWidth: '100%', } + if (value === false) { + return null + } + if (obj(value)) { const breakpointsStyle = reduceVariants( props,