Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when process transform #190

Open
lovetingyuan opened this issue Jan 25, 2024 · 3 comments
Open

error when process transform #190

lovetingyuan opened this issue Jan 25, 2024 · 3 comments

Comments

@lovetingyuan
Copy link

const transform = require('css-to-react-native')
const { prop, value } = {
  prop: 'transform',
  value: 'translate(0) rotate(0) skewX(0) skewY(0) scaleX(1.5) scaleY(1.5)',
}
const result = transform.default([[prop, value]])
console.log(result)

/**
 *     throw new Error("Failed to parse declaration \"" + propName + ": " + value + "\"");
    ^

Error: Failed to parse declaration "transform: translate(0) rotate(0) skewX(0) skewY(0) scaleX(1.5) scaleY(1.5)"
    at transformShorthandValue (/Users/tingyuan/Documents/lovetingyuan/minibili/node_modules/css-to-react-native/index.js:847:11)
    at getStylesForProperty (/Users/tingyuan/Documents/lovetingyuan/minibili/node_modules/css-to-react-native/index.js:856:109)
    at /Users/tingyuan/Documents/lovetingyuan/minibili/node_modules/css-to-react-native/index.js:879:33
    at Array.reduce (<anonymous>)
    at Object.index [as default] (/Users/tingyuan/Documents/lovetingyuan/minibili/node_modules/css-to-react-native/index.js:875:16)
    at Object.<anonymous> (/Users/tingyuan/Documents/lovetingyuan/minibili/a.js:6:33)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)

Node.js v18.17.1
 */
@jacobp100
Copy link
Contributor

I think translate needs two arguments

@lovetingyuan
Copy link
Author

I think translate needs two arguments

no, I add deg there is no error. value: 'translate(0) rotate(0deg) skewX(0deg) skewY(0deg) scaleX(1.5) scaleY(1.5)',

@lovetingyuan
Copy link
Author

I think this lib should handle this situation, because no deg unit is still valid syntax.

@jacobp100 jacobp100 reopened this Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants