forked from components-ai/css.gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFieldset.tsx
More file actions
44 lines (42 loc) · 1.05 KB
/
Fieldset.tsx
File metadata and controls
44 lines (42 loc) · 1.05 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
import { useState } from 'react'
import {
Editor,
styled,
Fieldset as FieldsetInput,
Inputs,
toCSSObject,
} from '@compai/css-gui'
export const Fieldset = () => {
const [styles, setStyles] = useState({})
return (
<>
<Editor styles={styles} onChange={setStyles}>
<>
<Inputs.FontSize />
<FieldsetInput type="pseudo-element" name="first-letter">
<>
<h2>First letter</h2>
<Inputs.FontSize />
</>
</FieldsetInput>
<FieldsetInput type="pseudo-element" name="selection">
<>
<h2>Selection</h2>
<Inputs.BackgroundColor />
</>
</FieldsetInput>
<FieldsetInput type="element" name="b">
<>
<h2>Bold</h2>
<Inputs.Color />
</>
</FieldsetInput>
</>
</Editor>
<styled.p styles={styles}>
Hello, <b>world!</b>
</styled.p>
<pre>{JSON.stringify(toCSSObject(styles), null, 2)}</pre>
</>
)
}