Skip to content

Commit

Permalink
feat: accept commas between transformations (#2950)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomura committed Nov 17, 2024
1 parent ab33e18 commit 266ff0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-ligers-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/stylesheet": patch
---

feat: accept commas between transformations
4 changes: 2 additions & 2 deletions packages/stylesheet/src/transform/transform.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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 });
}
}

Expand Down

0 comments on commit 266ff0d

Please sign in to comment.