-
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
Token aliases with invalid or unsuited intermediate value #196
Comments
Somewhat related : {
"one": {
"$type": "dimension",
"$value": "#ffffff"
},
"two": {
"$type": "color",
"$value": "{one}"
}
} Is |
My feeling here is that So, either:
or:
In either cases, the resolved type will always be whatever the aliased token's type is. I think option 2 fits best with the conversation in #139. |
Neither are possible due to composite types :/ There is no alias token here. "shadow": {
"medium": {
"$type": "shadow",
"$description": "A composite token where some sub-values are references to tokens that have the correct type and others are explicit values",
"$value": {
"color": "{color.shadow-050}",
"offsetX": "{space.small}",
"offsetY": "{space.small}",
"blur": "1.5rem",
"spread": "0rem"
}
}
}, Somewhere in this issue : #126 (comment) I propose the concept of a typed group over composite types. That never got much traction but in such a schema you could apply your solution. thinking about this more...
If a token is only a |
Yes, this is an issue that I think we need to dig into in a separate topic. Implicit typing of composite tokens makes sense, but requires a strict definition of all the keys that a composite token may have. In the case of typography, in CSS alone there are 57 properties that can change the way type appears. To make implicit typing work, and to not arbitrarily restrict the use case, we'd need to create and maintain a type mapping for all those properties, plus any additional properties on other platforms that aren't covered by CSS. For this issue, do you think requiring alias tokens to NOT have a type (proposal 1.) solves the issue? |
It might, but an error handling algorithm would also solve it. It is currently unspecified what to do in this case.
I am unsure what you mean, can you open a separate issue and elaborate? maybe with some examples? |
Related to #200 |
https://tr.designtokens.org/format/#aliases-references
https://tr.designtokens.org/format/#type-0
Example :
Is
three
a valid color token with value#ffffff
?Or is it invalid because the intermediate token has type
dimension
Currently this is ambiguous because there are not precisely defined parsing steps.
Dereferencing aliases doesn't mention type at all.
So it seems that types aren't a factor for this process.
The text was updated successfully, but these errors were encountered: