Skip to content

Commit

Permalink
Add Figma typography extensions (#891)
Browse files Browse the repository at this point in the history
* working on adding typo tokens for figma

* working on adding typo tokens for figma
  • Loading branch information
lukasoppermann authored Apr 19, 2024
1 parent 998fc24 commit 68d7424
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-carrots-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/primitives': minor
---

adding typo tokens for figma
32 changes: 28 additions & 4 deletions src/tokens/base/typography/typography.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,43 @@
"weight": {
"light": {
"$type": "fontWeight",
"$value": 300
"$value": 300,
"$extensions": {
"org.primer.figma": {
"collection": "base/typography",
"scopes": ["all"]
}
}
},
"normal": {
"$value": 400,
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "base/typography",
"scopes": ["all"]
}
}
},
"medium": {
"$value": 500,
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "base/typography",
"scopes": ["all"]
}
}
},
"semibold": {
"$value": 600,
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "base/typography",
"scopes": ["all"]
}
}
}
}
}
Expand Down
163 changes: 142 additions & 21 deletions src/tokens/functional/typography/typography.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,20 @@
},
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
"scopes": ["all"],
"fontSizeInPx": 40
}
}
},
"size": {
"$value": "40px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"lineHeight": {
"$value": 1.4,
Expand All @@ -65,7 +72,13 @@
},
"weight": {
"$value": "{base.text.weight.medium}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"shorthand": {
"$value": {
Expand All @@ -82,15 +95,33 @@
"size": {
"large": {
"$value": "32px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"medium": {
"$value": "20px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"small": {
"$value": "16px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
}
},
"lineHeight": {
Expand Down Expand Up @@ -137,15 +168,33 @@
"weight": {
"large": {
"$value": "{base.text.weight.semibold}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"medium": {
"$value": "{base.text.weight.semibold}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"small": {
"$value": "{base.text.weight.semibold}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
}
},
"shorthand": {
Expand Down Expand Up @@ -184,15 +233,33 @@
"subtitle": {
"size": {
"$value": "20px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"lineHeight": {
"$value": 1.6,
"$type": "number"
"$type": "number",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"weight": {
"$value": "{base.text.weight.normal}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"shorthand": {
"$value": {
Expand All @@ -209,15 +276,33 @@
"size": {
"large": {
"$value": "16px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"medium": {
"$value": "14px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"small": {
"$value": "12px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
}
},
"lineHeight": {
Expand Down Expand Up @@ -301,7 +386,13 @@
"caption": {
"size": {
"$value": "12px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"lineHeight": {
"$value": 1.3333,
Expand All @@ -318,7 +409,13 @@
},
"weight": {
"$value": "{base.text.weight.normal}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"shorthand": {
"$value": {
Expand All @@ -334,7 +431,13 @@
"codeBlock": {
"size": {
"$value": "13px",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"lineHeight": {
"$value": 1.5385,
Expand All @@ -351,7 +454,13 @@
},
"weight": {
"$value": "{base.text.weight.normal}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"shorthand": {
"$value": {
Expand All @@ -367,11 +476,23 @@
"codeInline": {
"size": {
"$value": "0.9285em",
"$type": "dimension"
"$type": "dimension",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"weight": {
"$value": "{base.text.weight.normal}",
"$type": "fontWeight"
"$type": "fontWeight",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["all"]
}
}
},
"shorthand": {
"$value": {
Expand Down

0 comments on commit 68d7424

Please sign in to comment.