-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from components-ai/directional-borders
Add directional borders
- Loading branch information
Showing
4 changed files
with
233 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@compai/css-gui': patch | ||
--- | ||
|
||
Add directional borders |
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,91 @@ | ||
import { useState } from 'react' | ||
import Link from 'next/link' | ||
import { Editor, Inputs, styled, codegen } from '@compai/css-gui' | ||
import { defaultTheme } from '../../data/default-theme' | ||
|
||
const initialStyles = { | ||
padding: { | ||
value: 64, | ||
unit: 'px', | ||
}, | ||
} | ||
|
||
export default function BorderImage() { | ||
const [styles, setStyles] = useState<any>(initialStyles) | ||
|
||
return ( | ||
<> | ||
<div | ||
className="full-bleed" | ||
sx={{ | ||
display: 'flex', | ||
py: [2, 3, 4], | ||
borderTopWidth: 'thin', | ||
}} | ||
> | ||
<div sx={{ px: [2, 3, 4] }}> | ||
<Editor styles={styles} onChange={setStyles} theme={defaultTheme}> | ||
<div sx={{ display: 'grid', gap: '.5rem', width: '240px' }}> | ||
<h3>Color</h3> | ||
<Inputs.BorderLeftColor /> | ||
<Inputs.BorderRightColor /> | ||
<Inputs.BorderTopColor /> | ||
<Inputs.BorderBottomColor /> | ||
<h3>Style</h3> | ||
<Inputs.BorderLeftStyle /> | ||
<Inputs.BorderRightStyle /> | ||
<Inputs.BorderTopStyle /> | ||
<Inputs.BorderBottomStyle /> | ||
<h3>Width</h3> | ||
<Inputs.BorderLeftWidth /> | ||
<Inputs.BorderRightWidth /> | ||
<Inputs.BorderTopWidth /> | ||
<Inputs.BorderBottomWidth /> | ||
<h3>Radius</h3> | ||
<Inputs.BorderTopLeftRadius /> | ||
<Inputs.BorderTopRightRadius /> | ||
<Inputs.BorderBottomLeftRadius /> | ||
<Inputs.BorderBottomRightRadius /> | ||
<h3>Spacing</h3> | ||
<Inputs.Padding /> | ||
<Inputs.Margin /> | ||
</div> | ||
</Editor> | ||
</div> | ||
<div sx={{ flexGrow: 1, pr: 4 }}> | ||
<styled.p styles={styles}> | ||
“The parameters comprise sequences which are theoretically infinite | ||
but limits are, of course, set to them in practice. There is an | ||
upward limit to size and certainly a downward one... Within these | ||
sequences there are reasonable bounds; extremes set by technical and | ||
functional experience” | ||
<br /> <br /> | ||
<em> | ||
In{' '} | ||
<Link | ||
href="https://www.lars-mueller-publishers.com/designing-programmes-0" | ||
passHref={true} | ||
> | ||
<a style={{ color: styles.color }}>Designing Programmes</a> | ||
</Link>{' '} | ||
by Karl Gerstner | ||
</em> | ||
</styled.p> | ||
</div> | ||
</div> | ||
<div className="full-bleed"> | ||
<pre | ||
sx={{ | ||
p: [2, 3, 4], | ||
borderTop: 'thin solid', | ||
borderColor: 'border', | ||
width: '100%', | ||
fontSize: 3, | ||
}} | ||
> | ||
{codegen.css(styles)} | ||
</pre> | ||
</div> | ||
</> | ||
) | ||
} |
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
8adde2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
css-gui – ./
css-gui-components-ai.vercel.app
css-gui-git-main-components-ai.vercel.app
css-gui.vercel.app