Skip to content

Commit 5de4025

Browse files
authored
letterSpacing is no longer a dimension token (#316) (#328)
1 parent 695cea7 commit 5de4025

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.changeset/smart-pianos-destroy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tokens-studio/sd-transforms': patch
3+
---
4+
5+
Addressed issue #316 about letterSpacing. LetterSpacing is no longer a dimension token. Also, the expand composition test token has been modify to test if the letterSpacing still works properly.

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const expandTypesMap = {
4949
sizing: 'dimension',
5050
borderRadius: 'dimension',
5151
borderWidth: 'dimension',
52-
letterSpacing: 'dimension',
5352
paragraphSpacing: 'dimension',
5453
paragraphIndent: 'dimension',
5554
text: 'content',

test/integration/expand-composition.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ describe('expand composition tokens', () => {
7373
--sdCompositionHeaderFontFamily: Roboto;
7474
--sdCompositionHeaderFontSize: 96px;
7575
--sdCompositionHeaderFontWeight: 700;
76+
--sdCompositionHeaderLineHeight: 1.25;
77+
--sdCompositionHeaderLetterSpacing: 1.25em;
7678
--sdTypography: italic 800 26px/1.25 Arial;
7779
--sdFontWeightRefWeight: 800;
7880
--sdFontWeightRefStyle: italic;
@@ -95,6 +97,8 @@ describe('expand composition tokens', () => {
9597
--sdCompositionHeaderFontFamily: Roboto;
9698
--sdCompositionHeaderFontSize: 96px;
9799
--sdCompositionHeaderFontWeight: 700;
100+
--sdCompositionHeaderLineHeight: 1.25;
101+
--sdCompositionHeaderLetterSpacing: 1.25em;
98102
--sdTypographyFontFamily: Arial;
99103
--sdTypographyFontWeight: 800;
100104
--sdTypographyLineHeight: 1.25;

test/integration/tokens/expand-composition.tokens.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"value": {
2525
"fontFamily": "{composition.fontFamily}",
2626
"fontSize": "96",
27-
"fontWeight": "{composition.fontWeight}"
27+
"fontWeight": "{composition.fontWeight}",
28+
"lineHeight": "125%",
29+
"letterSpacing": "125%"
2830
},
2931
"type": "composition"
3032
}

0 commit comments

Comments
 (0)