Skip to content

Commit

Permalink
converting line height to pixel value
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann committed Apr 19, 2024
1 parent 7934ec3 commit 5843c1a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-seas-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/primitives': patch
---

Convert lineHeight from float to pixel value for figma
4 changes: 4 additions & 0 deletions src/PrimerStyleDictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import {
shadowToCss,
typographyToCss,
dimensionToRemPxArray,
<<<<<<< HEAD
floatToPixel,
=======
convertWithFontSizeToPixel,
>>>>>>> c920fd97 (converting line height to pixel value)
} from './transformers'
import {
javascriptCommonJs,
Expand Down
1 change: 1 addition & 0 deletions src/platforms/figma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
15 changes: 12 additions & 3 deletions src/tokens/functional/typography/typography.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"text": {
"display": {
"lineBoxHeight": {
"$value": "56px",
"$type": "dimension",
"$value": 1.4,
"$type": "number",
"$extensions": {
"org.primer.data": {
"fontSize": 40
Expand All @@ -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}",
Expand Down

0 comments on commit 5843c1a

Please sign in to comment.