Skip to content

Commit

Permalink
add a display font family variant as figma does not automatically switch
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann committed Jun 17, 2024
1 parent 31e827d commit 9e11129
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
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 9e11129

Please sign in to comment.