diff --git a/.changeset/weak-cups-attack.md b/.changeset/weak-cups-attack.md
new file mode 100644
index 0000000..cd12021
--- /dev/null
+++ b/.changeset/weak-cups-attack.md
@@ -0,0 +1,6 @@
+---
+"@plextv/react-lightning-plugin-css-transform": patch
+"@plextv/react-lightning-example": patch
+---
+
+Allow transforms to be given as arrays
diff --git a/apps/react-lightning-example/package.json b/apps/react-lightning-example/package.json
index 3e20dbd..cf1ea21 100644
--- a/apps/react-lightning-example/package.json
+++ b/apps/react-lightning-example/package.json
@@ -26,6 +26,7 @@
"@plextv/react-lightning": "workspace:*",
"@plextv/react-lightning-components": "workspace:*",
"@plextv/react-lightning-plugin-flexbox": "workspace:*",
+ "@plextv/react-lightning-plugin-css-transform": "workspace:*",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "7.1.5",
diff --git a/apps/react-lightning-example/src/index.tsx b/apps/react-lightning-example/src/index.tsx
index c699df1..337c4ae 100644
--- a/apps/react-lightning-example/src/index.tsx
+++ b/apps/react-lightning-example/src/index.tsx
@@ -4,6 +4,7 @@ import {
type RenderOptions,
createRoot as createRootLng,
} from '@plextv/react-lightning';
+import { plugin as cssTransformPlugin } from '@plextv/react-lightning-plugin-css-transform';
import { plugin as flexPlugin } from '@plextv/react-lightning-plugin-flexbox';
import { createRoot as createRootDom } from 'react-dom/client';
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
@@ -16,6 +17,7 @@ import { Page60 } from './pages/Page60';
import { PosterPage } from './pages/PosterPage';
import { ShaderPage } from './pages/ShaderPage';
import { TexturePage } from './pages/TexturePage';
+import { TransformsPage } from './pages/TransformsPage';
import { MyCustomShader } from './shaders/MyCustomShader';
import { MyCustomTexture } from './shaders/MyCustomTexture';
import { NoiseEffect } from './shaders/NoiseEffect';
@@ -51,6 +53,10 @@ const router = createBrowserRouter([
path: '/texture',
element: ,
},
+ {
+ path: '/transforms',
+ element: ,
+ },
{
path: '/page60',
element: ,
@@ -77,7 +83,7 @@ const options: RenderOptions = {
}),
],
enableContextSpy: true,
- plugins: [flexPlugin()],
+ plugins: [cssTransformPlugin(), flexPlugin()],
effects: {
Noise: NoiseEffect,
StaticAlpha: StaticAlphaEffect,
diff --git a/apps/react-lightning-example/src/pages/TransformsPage.tsx b/apps/react-lightning-example/src/pages/TransformsPage.tsx
new file mode 100644
index 0000000..8f60c91
--- /dev/null
+++ b/apps/react-lightning-example/src/pages/TransformsPage.tsx
@@ -0,0 +1,56 @@
+import { Column, Row } from '@plextv/react-lightning-components';
+import { useCallback, useState } from 'react';
+import Button from '../components/Button';
+
+const img =
+ 'https://images.plex.tv/photo?size=large-720&scale=2&url=https://image.tmdb.org/t/p/original/65firYWt2FoK18KuYxnmHmVaEsL.jpg';
+
+export const TransformsPage = () => {
+ const [scale, setScale] = useState(1);
+ const [rotation, setRotation] = useState(0);
+
+ const scaleUp = useCallback(() => {
+ setScale((state) => state * 1.25);
+ }, []);
+ const scaleDown = useCallback(() => {
+ setScale((state) => state * 0.8);
+ }, []);
+ const rotateLeft = useCallback(() => {
+ setRotation((state) => state + 15);
+ }, []);
+ const rotateRight = useCallback(() => {
+ setRotation((state) => state - 15);
+ }, []);
+
+ return (
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/packages/plugin-css-transform/src/utils/convertCSSTransformToLightning.ts b/packages/plugin-css-transform/src/utils/convertCSSTransformToLightning.ts
index 17ffaad..ab1499c 100644
--- a/packages/plugin-css-transform/src/utils/convertCSSTransformToLightning.ts
+++ b/packages/plugin-css-transform/src/utils/convertCSSTransformToLightning.ts
@@ -96,6 +96,7 @@ export function convertCSSTransformToLightning(
transformResult.scaleY = getValue(transformValue, 1, Number.parseFloat);
break;
case 'rotate':
+ case 'rotation':
transformResult.rotation = getValue(
transformValue,
0,
diff --git a/packages/plugin-css-transform/src/utils/parseTransform.ts b/packages/plugin-css-transform/src/utils/parseTransform.ts
index 9ab6415..bf09f09 100644
--- a/packages/plugin-css-transform/src/utils/parseTransform.ts
+++ b/packages/plugin-css-transform/src/utils/parseTransform.ts
@@ -3,13 +3,42 @@ import { convertCSSTransformToLightning } from './convertCSSTransformToLightning
const transformPartRegex = /(\w+)\(([^)]+)\)/g;
-export function parseTransform(transform?: string): Transform {
+export function parseTransform(
+ transform?: string | object | Array