mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-24 19:26:26 +02:00
Add Masonry Grid
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user