You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Columns to accept oneThird, oneHalf, twoThirds array options (#8387)
### WHY are these changes introduced?
### WHAT is this pull request doing?
Columns now accepts an array of aliases for common sizes in the admin.
Note: the aliases are just that, aliases. If several are used that don't
add up to an even 100, then the results may not be as expected. They are
basically an easy way to set common column widths wrapped in `minmax()`.
<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>
```jsx
import React from 'react';
import {Box, Columns, Page} from '../src';
export function Playground() {
return (
<Page title="Playground">
{/* Add the code you want to test in here */}
<Columns>
<Box background="surface">one</Box>
<Box background="surface">two</Box>
<Box background="surface">three</Box>
<Box background="surface">four</Box>
<Box background="surface">five</Box>
<Box background="surface">six</Box>
<Box background="surface">seven</Box>
</Columns>
<hr />
<Columns columns={['oneThird', 'twoThirds']}>
<Box background="surface-attention">one</Box>
<Box background="surface-attention">two</Box>
<Box background="surface-attention">three</Box>
<Box background="surface-attention">four</Box>
<Box background="surface-attention">five</Box>
<Box background="surface-attention">six</Box>
<Box background="surface-attention">seven</Box>
</Columns>
<hr />
<Columns columns={{xs: 1, lg: ['twoThirds', 'oneThird']}}>
<Box background="surface">one</Box>
<Box background="surface">two</Box>
<Box background="surface">three</Box>
<Box background="surface">four</Box>
<Box background="surface">five</Box>
<Box background="surface">six</Box>
<Box background="surface">seven</Box>
</Columns>
<hr />
<Columns columns={3}>
<Box background="surface-attention">one</Box>
<Box background="surface-attention">two</Box>
<Box background="surface-attention">three</Box>
<Box background="surface-attention">four</Box>
<Box background="surface-attention">five</Box>
<Box background="surface-attention">six</Box>
<Box background="surface-attention">seven</Box>
</Columns>
<hr />
<Columns columns={['twoThirds', 'oneThird', 'oneHalf']}>
<Box background="surface">one</Box>
<Box background="surface">two</Box>
<Box background="surface">three</Box>
<Box background="surface">four</Box>
<Box background="surface">five</Box>
<Box background="surface">six</Box>
<Box background="surface">seven</Box>
</Columns>
</Page>
);
}
```
</details>
---------
Co-authored-by: Aaron Casanova <32409546+aaronccasanova@users.noreply.github.com>
0 commit comments