-
Notifications
You must be signed in to change notification settings - Fork 567
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
Crash when mixing refs and complex values in transitive transform #795
Comments
Is there a mailing list or a more active forum for Style Dictionary? |
Is anyone monitoring the bug tracker? |
My apologies, this project is community driven and supported by a few individuals. I recently had a 2nd baby and am dealing with a lot of work and personal things at the moment. We do monitor the issues and PRs and try to get them resolved in a timely manner, but some weeks/months things get slow. Thank you for your patience. Now onto your question. It appears our sorting and reference logic in our built-in formats does not handle arrays of objects as values well. It can handle an object as a value or a simple array, but not an array of objects. I see the issue is our internal |
Congrats on the baby! Or, sorry about the second kid. I don't know your situation. Thanks for the fix, will check it out tomorrow. I ended up implementing everything using regexs, but I'm keen to use objects instead of my CSS derived DSL. While I have you here. Style Dictionary has been great to work with. The docs are complete and absolutely everything just works as you would expect it to. |
@dbanksdesign I've been following your commits related to this, thanks for taking it on! |
I realized this is not released to npm yet, I was going to try to release today, but found a bug in our releasing scripts. Once I get that fixed and merged I can do a release to get this out! |
@dbanksdesign boom |
@dbanksdesign @michaelurban i am trying to transform complex box shadow tokens like as described in the beginning of this thread but cannot iterate over the array of objects to extract values. is there a fix in place? Thank you in advance guys!
|
Hello! I am curious if there have been any updates to this, as I am bumping into the same issue when dealing with shadows. Also, @michaelurban - curious if you would be willing/able to share a more fully functional version of the transform code you were working with for shadows, and what (if anything) got things working for you? Thanks! 🙏 🤜 🤛 |
Chiming in on boxShadow. Everything generated seems well and good, except for some boxShadow transforms which looked like this in my scss and css files:
They point to these tokens:
which again points to another file with these tokens:
My initial guess was that the nested references might cause the issue. Either way, I'm supplying an additional case to the mix. In case it is of relevance, I'm using tokens-studio for my transformGroup, so this might be an issue to take with them instead. |
I'm new to this issue in particular but this week I'm adding some stuff to style-dictionary v4 to deal with object-value tokens (aka composite tokens) and I'm planning to bring the CSS shorthand transforms from sd-transforms into style-dictionary, since these token types are now part of the DTCG spec and not Tokens Studio specific. I'll keep this issue open in a browser tab and ensure I add some tests for the use cases mentioned in this issue. |
I'm trying to do something that I haven't seen documented, but, should(?) work. It almost works, at any rate.
Example project here: box-shadow-example
I'm specifying box-shadows as a list:
tokens/box-shadows.refs.json
And, I'm using a transform to convert that into a valid CSS
box-shadow
property value.Expected Output (Ideal):
Alternatively, if it's not possible to output the token references, this would work as the expected output too:
Expected Output (Alternative):
Actual Output:
When I log the token values post-transform, I can see that the references are being substituted correctly:
The weird thing is, if I omit token references and hard-code the color values, my transform works as expected:
tokens/box-shadows.no-refs.json
Expected and actual output:
Bug? My fault? I won't be able to dig into the internals of SD for a bit. If anyone can tell me if this is a bug or why what I'm trying to do is impossible, I'd appreciate it.
The text was updated successfully, but these errors were encountered: