From b630390ab71cd6216eb2b833252078210e316b54 Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Mon, 22 Aug 2022 11:51:53 +0300 Subject: [PATCH] Revert "[@mantine/core] Grid: Fix offset and order responsive props (#2163)" This reverts commit 0326f9b75525a1acebaf69ae569c7b4b394a6fd3. --- src/mantine-core/src/Grid/Col/Col.styles.ts | 20 +++++++++---------- .../src/demos/core/Grid/Grid.demo.order.tsx | 6 +++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/mantine-core/src/Grid/Col/Col.styles.ts b/src/mantine-core/src/Grid/Col/Col.styles.ts index 3b5bc4eb574..5d7a084f2f2 100644 --- a/src/mantine-core/src/Grid/Col/Col.styles.ts +++ b/src/mantine-core/src/Grid/Col/Col.styles.ts @@ -50,17 +50,15 @@ function getBreakpointsStyles({ columns: number; }) { return MANTINE_SIZES.reduce((acc, size) => { - acc[`@media (min-width: ${theme.breakpoints[size] + 1}px)`] = { - order: orders[size], - flexBasis: typeof sizes[size] === 'number' ? getColumnWidth(sizes[size], columns) : 'auto', - flexShrink: 0, - maxWidth: grow - ? 'unset' - : typeof sizes[size] === 'number' - ? getColumnWidth(sizes[size], columns) - : 'none', - marginLeft: getColumnOffset(offsets[size], columns), - }; + if (typeof sizes[size] === 'number') { + acc[`@media (min-width: ${theme.breakpoints[size] + 1}px)`] = { + order: orders[size], + flexBasis: getColumnWidth(sizes[size], columns), + flexShrink: 0, + maxWidth: grow ? 'unset' : getColumnWidth(sizes[size], columns), + marginLeft: getColumnOffset(offsets[size], columns), + }; + } return acc; }, {}); } diff --git a/src/mantine-demos/src/demos/core/Grid/Grid.demo.order.tsx b/src/mantine-demos/src/demos/core/Grid/Grid.demo.order.tsx index c92fadb124d..bd30d356632 100644 --- a/src/mantine-demos/src/demos/core/Grid/Grid.demo.order.tsx +++ b/src/mantine-demos/src/demos/core/Grid/Grid.demo.order.tsx @@ -8,9 +8,9 @@ import { Grid } from '@mantine/core'; function Demo() { return ( - 2 - 3 - 1 + 2 + 3 + 1 ); }