1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-26 19:21:30 +01:00

Format pattern pages

This commit is contained in:
Phuoc Nguyen
2021-09-27 23:14:35 +07:00
parent 6403dfdf36
commit 9d394a8561
222 changed files with 8168 additions and 8468 deletions

View File

@@ -1,14 +1,10 @@
/**
* A collection of popular layouts and patterns made with CSS (https://csslayout.io)
* (c) 2019 - 2021 Nguyen Huu Phuoc <https://twitter.com/nghuuphuoc>
*/
import * as React from 'react';
import Head from 'next/head';
import { Spacer } from '@1milligram/design';
import { RelatedPatterns } from '../../components/RelatedPatterns';
import { Pattern } from '../../constants/Pattern';
import { DetailsLayout } from '../../layouts/DetailsLayout';
import { PatternLayout } from '../../layouts/PatternLayout';
import BrowserFrame from '../../placeholders/BrowserFrame';
import Rectangle from '../../placeholders/Rectangle';
@@ -63,16 +59,15 @@ const Details: React.FC<{}> = () => {
};
return (
<DetailsLayout pattern={Pattern.CustomCheckboxButton}>
<PatternLayout pattern={Pattern.CustomCheckboxButton}>
<Head>
<meta name="description" content="Create a custom checkbox button with CSS flexbox" />
<meta name="og:description" content="Create a custom checkbox button with CSS flexbox" />
<meta name="twitter:description" content="Create a custom checkbox button with CSS flexbox" />
<meta name="keywords" content="css checkbox, css flexbox" />
</Head>
<div className='p-8 pb-20'>
<BrowserFrame
html={`
<BrowserFrame
html={`
<label class="label">
<!-- The real checkbox -->
<input type="checkbox" class="label__input" />
@@ -87,91 +82,97 @@ html={`
...
</div>
`}
css={`
.label {
/* Center the content horizontally */
align-items: center;
display: inline-flex;
css={`
.label {
/* Center the content horizontally */
align-items: center;
display: inline-flex;
/* Cursor */
cursor: pointer;
}
/* Cursor */
cursor: pointer;
}
.label__input {
/* Hide it */
display: none;
}
.label__input {
/* Hide it */
display: none;
}
.label__square {
border: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 4px;
.label__square {
border: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 4px;
/* Spacing */
margin-right: 8px;
padding: 4px;
}
/* Spacing */
margin-right: 8px;
padding: 4px;
}
.label__checkbox {
background-color: transparent;
border-radius: 4px;
height: 16px;
width: 16px;
}
.label__checkbox {
background-color: transparent;
border-radius: 4px;
height: 16px;
width: 16px;
}
.label__checkbox--selected {
/* For selected checkbox */
background-color: #00449E;
}
`}
.label__checkbox--selected {
/* For selected checkbox */
background-color: #00449e;
}
`}
>
<div
style={{
alignItems: 'center',
display: 'flex',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<div
style={{
alignItems: 'center',
display: 'flex',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<div style={{ width: '200px' }}>
<div
style={{
alignItems: 'center',
display: 'inline-flex',
marginBottom: '16px',
}}
>
<Checkbox value='1' isChecked={false}>
<div style={{ width: '100px' }}><Rectangle /></div>
</Checkbox>
</div>
<div
style={{
alignItems: 'center',
display: 'inline-flex',
marginBottom: '16px',
}}
>
<Checkbox value='2' isChecked={true}>
<div style={{ width: '200px' }}><Rectangle /></div>
</Checkbox>
</div>
<div
style={{
alignItems: 'center',
display: 'inline-flex',
}}
>
<Checkbox value='3' isChecked={false}>
<div style={{ width: '150px' }}><Rectangle /></div>
</Checkbox>
</div>
<div style={{ width: '200px' }}>
<div
style={{
alignItems: 'center',
display: 'inline-flex',
marginBottom: '16px',
}}
>
<Checkbox value="1" isChecked={false}>
<div style={{ width: '100px' }}>
<Rectangle />
</div>
</Checkbox>
</div>
<div
style={{
alignItems: 'center',
display: 'inline-flex',
marginBottom: '16px',
}}
>
<Checkbox value="2" isChecked={true}>
<div style={{ width: '200px' }}>
<Rectangle />
</div>
</Checkbox>
</div>
<div
style={{
alignItems: 'center',
display: 'inline-flex',
}}
>
<Checkbox value="3" isChecked={false}>
<div style={{ width: '150px' }}>
<Rectangle />
</div>
</Checkbox>
</div>
</div>
</BrowserFrame>
</div>
</div>
</BrowserFrame>
<Spacer size="extraLarge" />
<RelatedPatterns patterns={[Pattern.CustomRadioButton, Pattern.RadioButtonGroup]} />
</DetailsLayout>
</PatternLayout>
);
};