-
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
Is there a way to still include boolean and string type functionality? #234
Comments
I can see several benefits of adding This is related to #134 and “create-your-own-type” which historically has been what the spec was trying to move away from by its design. In a pre-spec world, token types would be up to individual teams to define and enforce, which means there’s no concept of “validation,” and design engineers have to reinvent the wheel at every company they work at since generic tooling is hard to build (or it has to be incredibly configuration-heavy). So in one sense, I think it’s natural for DTCG to discourage this design initially. That said, users of the working draft of the DTCG spec are used to the builtin types, and have had to implement workarounds for their own token types like this. After all, ProposalSo would it be accurate to frame your proposal like so? I can see this basically just reserving these type names, and nothing else: {
"myBoolean": {
"$type": "boolean",
"$value": true
},
"myString": {
"$type": "string",
"$value": "foobar"
}
} Pros / consIn weighing it out, this isn’t exhaustive, but some likely arguments for- and against I can foresee:
The last two I don’t see as real issues, because tooling not being able to translate these well would discourage using these types in the first place unless it was for custom, one-off reasons. By using a more semantic type such as dimension or duration, tooling can do all the work translating to different platforms for you. But if a user has decidedly used So by marking these as “catchall” types, it just seems like a win–win for the spec: it dramatically lessens ad-hoc extensions to the spec where people are declaring |
Hallo everyone. I'm fairly new here and it goes without saying that I haven't read everything, so please bear with me.
Noticing the change not to allow basic JSON types in the spec anymore, I read up on the topic.
There were mentions that some types might not have obvious applications in UI design. Working on a design system currently, I just wanted to check in with a few thoughts - and I hope that opening an issue for that is ok. I'm not arguing to reopen that "JSON types"-discussion, I'm just wondering if there could be possibilities, like DTCG-specific types, for those appllications in the future.
Boolean:
I do think there are applications in UI design for a boolean type. E.g. the visibility of an element when defining the appearance of responsive components. Seeing what Figma is doing with modes, this becomes especially apparent.
String:
Same goes for string. It could be used to centrally define certain default captions or labels, placeholder texts, identifiers for modes, prefixes or other strings.
Number:
I know it's already been included for several good reasons, and here's one more: We use it to define the number of columns in our grid definitions.
I guess I'm wondering if boolean and string could still be included, maybe as a spec-specific type. I think these two are too important and basic to relegate them to proprietary extensions, especially since Figma now uses them too.
Also, P.S.: Since text-alignment was brought up, I was wondering about text-decoration and text-decoration-thickness.
Thank you all for the great work you're doing here - so many familiar names too. :)
The text was updated successfully, but these errors were encountered: