Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(theme): add font stack as fallback to custom property #4208

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/selfish-guests-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Update mono font in theme to use font stack as fallback to custom property
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/TextInput.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ exports[`TextInput renders monospace 1`] = `
align-items: stretch;
min-height: 32px;
overflow: hidden;
font-family: var(--fontStack-monospace),SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;
font-family: var(--fontStack-monospace,SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace);
}

.c0 input,
Expand Down
5 changes: 2 additions & 3 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ const fonts = {
'Apple Color Emoji',
'Segoe UI Emoji',
]),
mono: fontStack([
'var(--fontStack-monospace)',
mono: `var(--fontStack-monospace, ${fontStack([
'SFMono-Regular',
'Consolas',
'Liberation Mono',
'Menlo',
'Courier',
'monospace',
]),
])})`,
}

const lineHeights = {
Expand Down
Loading