diff --git a/.changeset/few-seas-invite.md b/.changeset/few-seas-invite.md new file mode 100644 index 000000000..2fe2753ed --- /dev/null +++ b/.changeset/few-seas-invite.md @@ -0,0 +1,5 @@ +--- +'@primer/primitives': patch +--- + +Convert lineHeight from float to pixel value for figma diff --git a/src/PrimerStyleDictionary.ts b/src/PrimerStyleDictionary.ts index fb3c8a6d6..285122c67 100644 --- a/src/PrimerStyleDictionary.ts +++ b/src/PrimerStyleDictionary.ts @@ -23,7 +23,11 @@ import { shadowToCss, typographyToCss, dimensionToRemPxArray, +<<<<<<< HEAD floatToPixel, +======= + convertWithFontSizeToPixel, +>>>>>>> c920fd97 (converting line height to pixel value) } from './transformers' import { javascriptCommonJs, diff --git a/src/platforms/figma.ts b/src/platforms/figma.ts index 9acb1505d..8b04b0094 100644 --- a/src/platforms/figma.ts +++ b/src/platforms/figma.ts @@ -28,6 +28,7 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option // 'name/pathToSlashNotation', 'figma/attributes', 'fontFamily/figma', + 'float/pixel', 'dimension/pixelUnitless', // 'border/figma', // 'typography/figma', diff --git a/src/tokens/functional/typography/typography.json b/src/tokens/functional/typography/typography.json index 214ab7a94..8fa6a4abf 100644 --- a/src/tokens/functional/typography/typography.json +++ b/src/tokens/functional/typography/typography.json @@ -34,8 +34,8 @@ "text": { "display": { "lineBoxHeight": { - "$value": "56px", - "$type": "dimension", + "$value": 1.4, + "$type": "number", "$extensions": { "org.primer.data": { "fontSize": 40 @@ -52,7 +52,16 @@ }, "lineHeight": { "$value": 1.4, - "$type": "number" + "$type": "number", + "$extensions": { + "org.primer.data": { + "fontSize": 40 + }, + "org.primer.figma": { + "collection": "typography", + "scopes": ["all"] + } + } }, "weight": { "$value": "{base.text.weight.medium}",