Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@mantine/core] Grid: Add auto and content spans (#2317)
* [@mantine/core] Grid: Add auto and content spans * Update demo copy * Add width of auto to breakpoint styles
- Loading branch information
1 parent
8528b3f
commit 66386e4
Showing
6 changed files
with
132 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { Grid } from '@mantine/core'; | ||
import { ColWrapper as Col } from './_col-wrapper'; | ||
|
||
const code = ` | ||
import { Grid } from '@mantine/core'; | ||
function Demo() { | ||
return ( | ||
<Grid> | ||
<Col span="auto">span=auto</Col> | ||
<Col span={6}>span=6</Col> | ||
<Col span="auto">span=auto</Col> | ||
</Grid> | ||
); | ||
} | ||
`; | ||
|
||
function Demo() { | ||
return ( | ||
<Grid> | ||
<Col span="auto">1</Col> | ||
<Col span={6}>2</Col> | ||
<Col span="auto">3</Col> | ||
</Grid> | ||
); | ||
} | ||
|
||
export const auto: MantineDemo = { | ||
type: 'demo', | ||
code, | ||
component: Demo, | ||
}; |
31 changes: 31 additions & 0 deletions
31
src/mantine-demos/src/demos/core/Grid/Grid.demo.content.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { Grid } from '@mantine/core'; | ||
import { ColWrapper as Col } from './_col-wrapper'; | ||
|
||
const code = ` | ||
import { Grid } from '@mantine/core'; | ||
function Demo() { | ||
return ( | ||
<Grid> | ||
<Col span="content">fit content</Col> | ||
<Col span={6}>2</Col> | ||
</Grid> | ||
); | ||
} | ||
`; | ||
|
||
function Demo() { | ||
return ( | ||
<Grid> | ||
<Col span="content">fit content</Col> | ||
<Col span={6}>2</Col> | ||
</Grid> | ||
); | ||
} | ||
|
||
export const content: MantineDemo = { | ||
type: 'demo', | ||
code, | ||
component: Demo, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters