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

Support interpolated variables in values #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dariocravero
Copy link

Support:

const val = 10;
<div style={{transform: "translateX(" + val + ")" }} />

Ref #12.

  • add failing test
  • fix it :)

@dariocravero
Copy link
Author

@salzhrani I think it has do to with the fact that the value is a BinaryExpression and it would have to be "flattened down" to a literal.

@salzhrani
Copy link

What if val is passed down, shouldn't the value stay as "translateX(" + val + ")"

@dariocravero
Copy link
Author

Oh, ok, sorry, from your example I thought you actually wanted the value converted! If you want it as a string then there's nothing to be done, it should just work as is... :)

@salzhrani
Copy link

Check my failing test ... it seems not to

@dariocravero
Copy link
Author

@salzhrani
Copy link

Yes ... I hope that that
<div style={{transform: "translateX(" + val + ")" }} />
would become something like
<div style={{transform: "translateX(" + val + ")" , webkitTransform: "translateX(" + val + ")", msTransform: "translateX(" + val + ")" }}, />

I apologize if couldn't convey my use case properly.

@salzhrani
Copy link

If you think this is out of the scope of the plugin ... feel free to close it.

@dariocravero
Copy link
Author

Sorry for the delay in answering. I don't know if it's necessarily out of scope but I don't really have time to go through it now :(. Feel free to send a patch if you manage to get around it :), I might do at some point and will let you know when that happens. Thanks, Darío

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

Successfully merging this pull request may close these issues.

2 participants