From 32c2d13400c5e73ee25f1dbf031f81868b22ba12 Mon Sep 17 00:00:00 2001 From: Joren Broekema Date: Mon, 29 Jul 2024 15:58:29 +0200 Subject: [PATCH] fix: keep textCase and textDecoration token types as is (#302) --- .changeset/smart-pets-rush.md | 5 +++++ src/index.ts | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .changeset/smart-pets-rush.md diff --git a/.changeset/smart-pets-rush.md b/.changeset/smart-pets-rush.md new file mode 100644 index 0000000..2478854 --- /dev/null +++ b/.changeset/smart-pets-rush.md @@ -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. diff --git a/src/index.ts b/src/index.ts index 6e9bf73..40e72e8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 }, };