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

Future-proofing Changes from the DTCG Specifications #3236

Open
keeganedwin opened this issue Dec 24, 2024 · 0 comments
Open

Future-proofing Changes from the DTCG Specifications #3236

keeganedwin opened this issue Dec 24, 2024 · 0 comments
Labels
💡request Community feedback Token Format Legacy and W3C DTCG conversion and JSON W3C DTCG Alignment with specification

Comments

@keeganedwin
Copy link
Collaborator

keeganedwin commented Dec 24, 2024

Is your feature request related to a problem? Please describe.
We need to find a system to keep up-to-date with the DTCG spec's future changes. One such change for example is how the plugin currently saves a dimension token:

"dimension": {
"scale": {
"$type": "dimension"
"$value": "2"

As opposed to how it has most recently been defined in the spec. Particularly the use of $value as well as value:

"spacing-stack-0": {
    "$value": {
      "value": 0,
      "unit": "px"
    },
    "$type": "dimension"

Current gaps found (by Jacob Morrison) between DTCG spec and Tokens Studio's automated transformation:

Values
dimension tokens should have a value of { "value": number, "unit": 'px' | 'rem' }
opacity tokens should have a number value (instead of a string)
duration tokens should have a value of { "value": number, "unit": 'ms' | 's' }

Outdated types
"$type": "spacing" should be "$type": "dimension"
"$type": "sizing" should be "$type": "dimension"
"$type": "borderRadius" should be "$type": "dimension"
"$type": "borderWidth" should be "$type": "dimension"
"$type": "opacity" should be "$type": "number" (revisit the spec, there is currently a note about potentially adding a percentage type for this use case)
lineHeights, fontWeights, fontFamilies, and fontSizes are typed incorrectly, preferring plural terminology to the spec's single-value terminology (e.g. TS: fontFamilies, spec: fontFamily)

Missing composites
TS uses its own boxShadow composite token. DTCG has a shadow type composite spec
Border styles can be implemented as composite border tokens

@keeganedwin keeganedwin added 💡request Community feedback W3C DTCG Alignment with specification Token Format Legacy and W3C DTCG conversion and JSON labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡request Community feedback Token Format Legacy and W3C DTCG conversion and JSON W3C DTCG Alignment with specification
Projects
Status: 📥 Triage
Development

No branches or pull requests

1 participant