Skip to content

fix: keep textCase and textDecoration token types as is #302

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

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smart-pets-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': patch
---

textCase and textDecoration types should be kept, instead of changing to "other". This should help with transforms targeting those tokens, whereas "other" is not a useful type conversion whatsoever.
10 changes: 4 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ export const expandTypesMap = {
typography: {
paragraphSpacing: 'dimension',
paragraphIndent: 'dimension',
textDecoration: 'other',
textCase: 'other',
// even though this type does not yet exist in DTCG, it really should, since lineHeights can be both dimension or number
lineHeight: 'lineHeight',
// same as lineHeight except for fontWeight: recognized fontWeight keys (e.g. "regular") should be recognized as well as numbers
fontWeight: 'fontWeight',
// for types "textDecoration", "textCase", "fontWeight", "lineHeight", we should keep the type as is
// because no DTCG type that currently exists provides a good match.
// for fontWeight: recognized fontWeight keys (e.g. "regular")
// for lineHeight: lineHeights can be both dimension or number
},
};
Loading