1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-24 11:16:27 +02:00

Add Masonry Grid

This commit is contained in:
Phuoc Nguyen
2021-04-28 16:29:01 +07:00
parent 7db5795d26
commit c5e6d4f140
7 changed files with 253 additions and 104 deletions

View File

@@ -21,8 +21,7 @@ const Details: React.FC<{}> = () => {
<meta name="twitter:description" content="Create a simple grid with CSS flexbox" />
<meta name="keywords" content="css flexbox, css flexbox grid, css grid, css layout" />
</Helmet>
<div className='p-8 pb-20'>
<BrowserFrame
<BrowserFrame
html={`
<!-- Row -->
<div class="row">
@@ -57,92 +56,91 @@ css={`
flex: 1;
}
`}
>
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<div style={{ width: '60%' }}>
<div style={{ display: 'flex', margin: '0 -8px 8px -8px' }}>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ width: '60%' }}>
<div style={{ display: 'flex', margin: '0 -8px 8px -8px' }}>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ display: 'flex', margin: '0 -8px 32px -8px' }}>
<div style={{ flex: '0 0 50%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
</div>
<div style={{ display: 'flex', margin: '0 -8px 8px -8px' }}>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ display: 'flex', margin: '0 -8px 32px -8px' }}>
<div style={{ flex: '0 0 50%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ display: 'flex', margin: '0 -8px 32px -8px' }}>
<div style={{ flex: '0 0 33.3333%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ display: 'flex', margin: '0 -8px 8px -8px' }}>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
</div>
<div style={{ display: 'flex', margin: '0 -8px 0 -8px' }}>
<div style={{ flex: '0 0 25%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '0 0 33.3333%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ display: 'flex', margin: '0 -8px 8px -8px' }}>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
</div>
<div style={{ display: 'flex', margin: '0 -8px 32px -8px' }}>
<div style={{ flex: '0 0 33.3333%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
</div>
<div style={{ display: 'flex', margin: '0 -8px 8px -8px' }}>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
</div>
<div style={{ display: 'flex', margin: '0 -8px 0 -8px' }}>
<div style={{ flex: '0 0 25%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '1', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
<div style={{ flex: '0 0 33.3333%', padding: '0 8px' }}>
<Rectangle height={32} />
</div>
</div>
</div>
</BrowserFrame>
</div>
</div>
</BrowserFrame>
<RelatedPatterns patterns={[Pattern.CardLayout]} />
<RelatedPatterns patterns={[Pattern.CardLayout, Pattern.MasonryGrid]} />
</DetailsLayout>
);
};