forked from components-ai/css.gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborders.tsx
More file actions
118 lines (115 loc) · 3.53 KB
/
borders.tsx
File metadata and controls
118 lines (115 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import { useState } from 'react'
import Link from 'next/link'
import { Editor, Inputs, styled, codegen } from '@compai/css-gui'
import { defaultTheme } from '../../data/default-theme'
import { Container } from '../../components/Container'
const initialStyles = {
padding: {
value: 64,
unit: 'px',
},
borderLeftColor: '#6465ff',
borderLeftStyle: 'double',
borderLeftWidth: {
value: 16,
unit: 'px',
},
borderRightColor: '#6465ff',
borderRightStyle: 'groove',
borderRightWidth: {
value: 16,
unit: 'px',
},
borderTopColor: '#6465ff',
borderTopStyle: 'dotted',
borderTopWidth: {
value: 16,
unit: 'px',
},
borderBottomColor: '#6465ff',
borderBottomStyle: 'dashed',
borderBottomWidth: {
value: 16,
unit: 'px',
},
}
export default function BorderImage() {
const [styles, setStyles] = useState<any>(initialStyles)
return (
<>
<div
className="full-bleed"
sx={{
py: [2, 3, 4],
px: 5,
borderTopWidth: 'thin',
}}
>
<div sx={{ flexGrow: 1, fontSize: [4,5,5], my: 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: 'inherit' }}>Designing Programmes</a>
</Link>{' '}
by Karl Gerstner
</em>
</styled.p>
</div>
<Editor styles={styles} onChange={setStyles} theme={defaultTheme}>
<div>
<h4>Borders</h4>
<article sx={{ display: 'grid', gap: '1rem', gridTemplateColumns: '1.25fr 2fr 2fr', maxWidth: '32rem', width: '100%', }}>
<Inputs.BorderLeftColor />
<Inputs.BorderLeftStyle />
<Inputs.BorderLeftWidth />
<Inputs.BorderRightColor />
<Inputs.BorderRightStyle />
<Inputs.BorderRightWidth />
<Inputs.BorderTopColor />
<Inputs.BorderTopStyle />
<Inputs.BorderTopWidth />
<Inputs.BorderBottomColor />
<Inputs.BorderBottomStyle />
<Inputs.BorderBottomWidth />
</article>
<article sx={{ maxWidth: '32rem', width: '100%', }}>
<h4>Radius</h4>
<Inputs.BorderTopLeftRadius />
<Inputs.BorderTopRightRadius />
<Inputs.BorderBottomLeftRadius />
<Inputs.BorderBottomRightRadius />
</article>
<article sx={{ maxWidth: '32rem', width: '100%', }}>
<h4>Spacing</h4>
<Inputs.Padding />
<Inputs.Margin />
</article>
</div>
</Editor>
</div>
<div>
<pre
sx={{
p: [2, 3, 4],
borderTop: 'thin solid',
borderColor: 'border',
width: '100%',
fontSize: 3,
}}
>
{codegen.css(styles)}
</pre>
</div>
</>
)
}