From 9b237e4b3bb5956d49d472fe3f022f32c0c4ec1c Mon Sep 17 00:00:00 2001 From: Diego Muracciole Date: Sun, 17 Nov 2024 01:16:08 +0100 Subject: [PATCH] feat: accept commas between transformations --- packages/stylesheet/src/transform/transform.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stylesheet/src/transform/transform.js b/packages/stylesheet/src/transform/transform.js index 996ac3bcc..a18a5b2ab 100644 --- a/packages/stylesheet/src/transform/transform.js +++ b/packages/stylesheet/src/transform/transform.js @@ -1,5 +1,5 @@ const parse = (transformString) => { - const transforms = transformString.trim().split(/\) |\)/); + const transforms = transformString.trim().split(/\)[ ,]|\)/); // Handle "initial", "inherit", "unset". if (transforms.length === 1) { @@ -15,7 +15,7 @@ const parse = (transformString) => { const [name, rawValue] = transform.split('('); const splitChar = rawValue.indexOf(',') >= 0 ? ',' : ' '; const value = rawValue.split(splitChar).map((val) => val.trim()); - parsed.push({ operation: name, value }); + parsed.push({ operation: name.trim(), value }); } }