<>
-
+
“The parameters comprise sequences which are theoretically infinite
but limits are, of course, set to them in practice. There is an
@@ -68,37 +99,45 @@ export default function BorderImage() {
-
-
-
Borders
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Radius
-
-
-
-
-
-
- Spacing
-
-
-
-
-
+
+
+
Borders
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Radius
+
+
+
+
+
+
+ Spacing
+
+
+
+
+
(initialStyles)
-
- return (
-
- )
-}
diff --git a/apps/docs/pages/examples/filters.tsx b/apps/docs/pages/examples/filters.tsx
index 8a7124a4..68ca6a3a 100644
--- a/apps/docs/pages/examples/filters.tsx
+++ b/apps/docs/pages/examples/filters.tsx
@@ -1,47 +1,48 @@
-import { Editor, styled } from '@compai/css-gui'
+import { Editor, Inputs, styled, toCSSObject } from '@compai/css-gui'
import { useState } from 'react'
import { Container } from '../../components/Container'
-const initialStyles = {
- filter: [{ type: 'sepia', amount: { value: 50, unit: '%' } }],
-}
-
export default function Filters() {
- const [styles, setStyles] = useState
(initialStyles)
+ const [styles, setStyles] = useState({
+ filter: [
+ {
+ name: 'blur',
+ arguments: { value: 8, unit: 'px' },
+ },
+ ],
+ })
+
return (
-
-
-
-
+
+
+
+
- Fun with filters
-
-
+
+ Fun with filters
+
+
)
diff --git a/apps/docs/pages/examples/flex.tsx b/apps/docs/pages/examples/flex.tsx
index ff3a28e6..d22d99f8 100644
--- a/apps/docs/pages/examples/flex.tsx
+++ b/apps/docs/pages/examples/flex.tsx
@@ -1,8 +1,6 @@
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 = {
display: 'flex',
@@ -35,7 +33,7 @@ export default function TextDecoration() {
@@ -72,23 +70,94 @@ export default function TextDecoration() {
-
- 
One
- 
Two
- 
Three
- 
Four
- 
Five
- 
Six
- 
Seven
- 
Eight
- 
Nine
- 
Ten
- 
Eleven
- 
Twelve
+
+

+ One
+
+
+

+ Two
+
+
+

+ Three
+
+
+

+ Four
+
+
+

+ Five
+
+
+

+ Six
+
+
+

+ Seven
+
+
+

+ Eight
+
+
+

+ Nine
+
+
+

+ Ten
+
+
+

+ Eleven
+
+
+

+ Twelve
+
-
+
({
const initialStyles = {
transform: [
- { type: 'perspective', amount: { value: 512, unit: 'px' } },
- { type: 'rotateX', amount: { value: 15, unit: 'deg' } },
- { type: 'rotateY', amount: { value: 15, unit: 'deg' } },
+ { name: 'perspective', arguments: { value: 512, unit: 'px' } },
+ { name: 'rotateX', arguments: { value: 15, unit: 'deg' } },
+ { name: 'rotateY', arguments: { value: 15, unit: 'deg' } },
],
}
diff --git a/apps/docs/pages/examples/grid.tsx b/apps/docs/pages/examples/grid.tsx.tmp
similarity index 100%
rename from apps/docs/pages/examples/grid.tsx
rename to apps/docs/pages/examples/grid.tsx.tmp
diff --git a/apps/docs/pages/examples/masks.tsx b/apps/docs/pages/examples/masks.tsx
index e51cffcd..909918c7 100644
--- a/apps/docs/pages/examples/masks.tsx
+++ b/apps/docs/pages/examples/masks.tsx
@@ -8,23 +8,19 @@ const initialStyles = {
{
clip: 'border-box',
image: {
- type: 'url',
- arguments: ['https://source.unsplash.com/random'],
+ name: 'url',
+ arguments: 'https://dlu344star2bj.cloudfront.net/i/3090-0015.jpg',
},
origin: 'border-box',
position: {
- x: { value: 0, type: '%' },
- y: { value: 0, type: '%' },
- },
- repeat: {
- x: 'no-repeat',
- y: 'no-repeat',
- },
- size: {
- type: 'dimensions',
- x: { value: 100, unit: '%' },
- y: { value: 100, unit: '%' },
+ x: { value: 0, unit: '%' },
+ y: { value: 0, unit: '%' },
},
+ repeat: ['no-repeat', 'no-repeat'],
+ size: [
+ { value: 100, unit: '%' },
+ { value: 100, unit: '%' },
+ ],
composite: 'add',
mode: 'luminance',
},
@@ -35,13 +31,16 @@ export default function MaskExample() {
const [styles, setStyles] = useState(initialStyles)
return (
-
- img': {maxWidth: '100%', display: 'block'} }}>
-

-
-
-
-
+
+ img': { maxWidth: '100%', display: 'block' } }}>
+

+
+
+
+
)
diff --git a/apps/docs/pages/examples/offset.tsx b/apps/docs/pages/examples/offset.tsx
index feb434ad..67c926f6 100644
--- a/apps/docs/pages/examples/offset.tsx
+++ b/apps/docs/pages/examples/offset.tsx
@@ -2,20 +2,25 @@ import { Editor, toCSSObject } from '@compai/css-gui'
import { useState } from 'react'
const initialStyles = {
- offsetPath: {
- shape: {
- type: 'path',
- path: 'M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80',
+ offset: {
+ path: {
+ type: 'shape',
+ shape: {
+ name: 'path',
+ arguments: 'M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80',
+ },
+ box: 'margin-box',
+ },
+ anchor: { x: 'center', y: 'center' },
+ distance: { value: 50, unit: '%' },
+ rotate: { value: 0, unit: 'deg' },
+ position: {
+ x: { value: 50, unit: '%' },
+ y: { value: 50, unit: '%' },
},
- box: 'margin-box',
- },
- offsetAnchor: {
- x: { value: 'center', unit: 'keyword' },
- y: { value: 'center', unit: 'keyword' },
},
- offsetDistance: { value: 50, unit: '%' },
- offsetRotate: { value: 0, unit: 'deg' },
}
+
export default function OffsetExample() {
const [styles, setStyles] = useState(initialStyles)
return (
diff --git a/apps/docs/pages/examples/shadows.tsx b/apps/docs/pages/examples/shadows.tsx
index f4664d89..da9860ea 100644
--- a/apps/docs/pages/examples/shadows.tsx
+++ b/apps/docs/pages/examples/shadows.tsx
@@ -1,4 +1,4 @@
-import { Editor, styled } from '@compai/css-gui'
+import { Editor, styled, toCSSObject } from '@compai/css-gui'
import { useState } from 'react'
import { Container } from '../../components/Container'
@@ -45,8 +45,8 @@ export default function Shadows() {
justifyContent: 'center',
}}
>
-
Fun with shadows
-
+
-
diff --git a/apps/docs/pages/examples/shape-outside.tsx b/apps/docs/pages/examples/shape-outside.tsx
index 5776ca53..4b4aea2e 100644
--- a/apps/docs/pages/examples/shape-outside.tsx
+++ b/apps/docs/pages/examples/shape-outside.tsx
@@ -5,12 +5,11 @@ const initialStyles = {
shapeOutside: {
type: 'shape',
shape: {
- type: 'inset',
- top: { value: 2, unit: 'px' },
- right: { value: 2, unit: 'px' },
- bottom: { value: 2, unit: 'px' },
- left: { value: 2, unit: 'px' },
- borderRadius: { value: 16, unit: 'px' },
+ name: 'inset',
+ arguments: {
+ offset: { top: { value: 2, unit: 'px' } },
+ borderRadius: { value: 16, unit: 'px' },
+ },
},
box: 'margin-box',
},
@@ -29,7 +28,7 @@ export default function ShapeOutsideExample() {
return (
-
)
}
diff --git a/apps/docs/pages/examples/simple-button.tsx b/apps/docs/pages/examples/simple-button.tsx
index 7c3c8046..097d01ec 100644
--- a/apps/docs/pages/examples/simple-button.tsx
+++ b/apps/docs/pages/examples/simple-button.tsx
@@ -11,11 +11,13 @@ const initialStyles = {
},
appearance: 'none',
borderWidth: {
- value: 0,
- unit: 'px',
+ top: {
+ value: 0,
+ unit: 'px',
+ },
},
- fontWeight: '600',
- fontSize: '16px',
+ fontWeight: 600,
+ fontSize: { value: 16, unit: 'px' },
outlineWidth: {
value: 0,
unit: 'px',
@@ -25,12 +27,12 @@ const initialStyles = {
value: 0,
unit: 'px',
},
- 'hover': {
+ hover: {
color: '#ffffff',
backgroundColor: '#3e38b0',
outlineColor: '#3e38b0',
},
- 'focus': {
+ focus: {
color: '#ffffff',
backgroundColor: '#3e38b0',
outlineWidth: {
@@ -42,9 +44,9 @@ const initialStyles = {
outlineOffset: {
value: 4,
unit: 'px',
- }
+ },
},
- 'active': {
+ active: {
color: '#ffffff',
backgroundColor: '#8170ff',
outlineColor: '#8170ff',
@@ -54,45 +56,68 @@ const initialStyles = {
export default function SimpleButton() {
const [styles, setStyles] = useState
(initialStyles)
return (
-
-
+
+ boxShadow:
+ 'inset 0 0 0 1px rgba(0,0,0,.2), inset 0 0 0 1px rgba(255,255,255,.2)',
+ }}
+ >
-
+
-
+
-