Skip to content

Commit 77e480c

Browse files
authored
feat: accept commas between transformations (#2950)
1 parent fb848a7 commit 77e480c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/smart-ligers-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-pdf/stylesheet": patch
3+
---
4+
5+
feat: accept commas between transformations

packages/stylesheet/src/transform/transform.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const parse = (transformString) => {
2-
const transforms = transformString.trim().split(/\) |\)/);
2+
const transforms = transformString.trim().split(/\)[ ,]|\)/);
33

44
// Handle "initial", "inherit", "unset".
55
if (transforms.length === 1) {
@@ -15,7 +15,7 @@ const parse = (transformString) => {
1515
const [name, rawValue] = transform.split('(');
1616
const splitChar = rawValue.indexOf(',') >= 0 ? ',' : ' ';
1717
const value = rawValue.split(splitChar).map((val) => val.trim());
18-
parsed.push({ operation: name, value });
18+
parsed.push({ operation: name.trim(), value });
1919
}
2020
}
2121

0 commit comments

Comments
 (0)