Skip to content

Commit

Permalink
Add a display font family variant as Figma does not automatically swi…
Browse files Browse the repository at this point in the history
…tch (#970)

* add a display font family variant as figma does not automatically switch

* add changeset
  • Loading branch information
lukasoppermann authored Jun 18, 2024
1 parent 52d8bf7 commit 395d45f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-steaks-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/primitives': patch
---

Add a display font family variant as Figma does not automatically switch
1 change: 1 addition & 0 deletions src/platforms/figma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option
fontFamilies: {
'fontStack/system': 'SF Pro Text',
'fontStack/sansSerif': 'SF Pro Text',
'fontStack/sansSerifDisplay': 'SF Pro Display',
'fontStack/monospace': 'SF Mono',
},
...options,
Expand Down
18 changes: 14 additions & 4 deletions src/tokens/functional/typography/typography.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
}
}
},
"sansSerifDisplay": {
"$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
"$type": "fontFamily",
"$extensions": {
"org.primer.figma": {
"collection": "typography",
"scopes": ["fontFamily"]
}
}
},
"monospace": {
"$value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
"$type": "fontFamily",
Expand Down Expand Up @@ -85,7 +95,7 @@
"fontWeight": "{text.display.weight}",
"fontSize": "{text.display.size}",
"lineHeight": "{text.display.lineHeight}",
"fontFamily": "{fontStack.sansSerif}"
"fontFamily": "{fontStack.sansSerifDisplay}"
},
"$type": "typography",
"$description": "Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports."
Expand Down Expand Up @@ -203,7 +213,7 @@
"fontWeight": "{text.title.weight.large}",
"fontSize": "{text.title.size.large}",
"lineHeight": "{text.title.lineHeight.large}",
"fontFamily": "{fontStack.sansSerif}"
"fontFamily": "{fontStack.sansSerifDisplay}"
},
"$type": "typography",
"$description": "Page headings for user-created objects, such as issues or pull requests. Utilize title (medium) styles on narrow viewports."
Expand All @@ -213,7 +223,7 @@
"fontWeight": "{text.title.weight.medium}",
"fontSize": "{text.title.size.medium}",
"lineHeight": "{text.title.lineHeight.medium}",
"fontFamily": "{fontStack.sansSerif}"
"fontFamily": "{fontStack.sansSerifDisplay}"
},
"$type": "typography",
"$description": "Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition."
Expand Down Expand Up @@ -269,7 +279,7 @@
"fontWeight": "{text.subtitle.weight}",
"fontSize": "{text.subtitle.size}",
"lineHeight": "{text.subtitle.lineHeight}",
"fontFamily": "{fontStack.sansSerif}"
"fontFamily": "{fontStack.sansSerifDisplay}"
},
"$type": "typography",
"$description": "Page sections/sub headings, or less important object names in page titles (automated action titles, for example). Same line-height as title (medium)."
Expand Down

0 comments on commit 395d45f

Please sign in to comment.