-
Notifications
You must be signed in to change notification settings - Fork 63
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
Computed Token Values #81
Comments
Computed values is something that's been asked for a number of times, so I'd certainly agree that it deserves consideration. I would also agree that it's too much for the initial, MVP spec. I can imagine there's a fair bit of complexity when you get into the weeds of it - for instance, if we had a Also, where do you draw the line? I can imagine use-cases for some arithmetic, so it might be tempting to allow My hope is that, in the meantime, tools will fill that gap. Perhaps someone will make a token pre-processor tool (e.g. something along the lines of what SASS is to CSS)? Just because today's tools tend to either extract tokens from elsewhere (e.g. visual design tools), or translate tokens into other languages (e.g. StyleDictionary and Theo) doesn't mean there couldn't one day be tools that read a token file, manipulate it in someway and then write out a different token file. ;-)
Perhaps. I never really thought of it that way. To me It's also worth noting that the concept of default-font-size-relative length values is not unique to the web. Android has it too, they just have a different name of it: |
Thanks for the reply @c1rrus! Yeah, I can definitely see how it makes the spec much more complex to support custom functions. I’d probably draw the line at basic arithmetic like I think CSS does with I want to make sure it’s clear that I’m fully on board with using I’m not sure I have any answers here, but I think it’s interesting to be able to define how parts of a system are relative to each other versus relative to some other master unit. That said, a pre-processor, or doing a little basic math (paired with a comment denoting the relative nature) when defining tokens could also do that. |
Closing this issue, but feel free to post use-cases below, and we will reopen it if appropriate. |
Closing this issue as per @kaelig's comment above. But, wanted to add that there is an active debate around more-or-less the same idea over in issue #88 (though it's mostly focussing on colors). To make future discussions easier to follow, I suggest additional ideas, use-cases, etc. are added as comments to #88 rather than here. |
This may be a bit much for the MVP spec, but should the spec allow for computed values?
Much of tokens is around defining a system, and much of a system is about relative choices. It'd be nice to define the relative nature of those choices when defining the values. This could apply to colors via things like "tint" and in numbers via basic arithmetic.
It looks like this concept is already underway in the dimension's suggestion to use
rem
. Isn't that really setting the value relative to an arbitrary master unit that only has value in the Web?The text was updated successfully, but these errors were encountered: