Skip to content
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
Binary file added docs/public/fonts/paper-mono.woff2
Binary file not shown.
7 changes: 7 additions & 0 deletions docs/src/app/(docs)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export default function Layout({ children }: React.PropsWithChildren) {
type="font/woff2"
crossOrigin="anonymous"
/>
<link
rel="preload"
href="/fonts/paper-mono.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
</head>
<body suppressHydrationWarning>
<GoogleAnalytics>
Expand Down
6 changes: 6 additions & 0 deletions docs/src/components/Code.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
.Code {
letter-spacing: normal;

p &[data-inline] {
letter-spacing: -0.01em;
word-spacing: -0.2em;
line-height: normal;
}

/* In a code block */
pre & {
white-space: normal;
Expand Down
78 changes: 8 additions & 70 deletions docs/src/css/fonts/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,81 +23,19 @@
}

@font-face {
font-family: 'SF Mono';
font-family: 'Paper Mono';
font-weight: normal;
src: local('SFMono-Regular'), local('ui-monospace');
/* Match 14px Unica to 13.25px SF Mono */
size-adjust: calc(100% * 13.25 / 14);
}

@font-face {
font-family: 'SF Mono';
font-weight: bold;
src: local('SFMono-Bold'), local('ui-monospace');
/* Match 14px Unica to 13.25px SF Mono */
size-adjust: calc(100% * 13.25 / 14);
}

@font-face {
font-family: Menlo;
font-weight: normal;
src: local('Menlo-Regular');
/* Match other monospace fonts to SF Mono in width */
size-adjust: calc(100% * 13.5 / 14);
ascent-override: 95%;
}

@font-face {
font-family: Menlo;
font-weight: bold;
src: local('Menlo-Bold');
/* Match other monospace fonts to SF Mono in width */
size-adjust: calc(100% * 13.5 / 14);
ascent-override: 95%;
}

@font-face {
font-family: Consolas;
font-weight: normal;
src: local('Consolas');
/* Match other monospace fonts to SF Mono in width */
size-adjust: calc(100% * 14.75 / 14);
ascent-override: 85%;
}

@font-face {
font-family: Consolas;
font-weight: bold;
src: local('Consolas-Bold');
/* Match other monospace fonts to SF Mono in width */
size-adjust: calc(100% * 14.75 / 14);
ascent-override: 85%;
}

@font-face {
font-family: 'DejaVu Sans Mono';
font-weight: normal;
src: local('DejaVuSansMono');
src: url('/fonts/paper-mono.woff2') format('woff2');
font-variation-settings: 'wght' 415;
/* Reduce the size to balance with the sans-serif fonts */
size-adjust: calc(100% * 13.5 / 14);
}

@font-face {
font-family: 'DejaVu Sans Mono';
font-family: 'Paper Mono';
font-weight: bold;
src: local('DejaVuSansMono-Bold');
src: url('/fonts/paper-mono.woff2') format('woff2');
font-variation-settings: 'wght' 650;
/* Reduce the size to balance with the sans-serif fonts */
size-adjust: calc(100% * 13.5 / 14);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we still need this? With this, the vertical alignment seems to be a bit off.

with size-adjust without size-adjust
Image Image
Image Image
Image Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd absolutely keep it personally

When zooming in like this, yeah, its obvious that the letters are different height, but when looking at actual paragraphs I think monospace fonts stand out as way larger and overpowering. Visually it looks more balanced to me when the monospace is downsized.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the vertical alignment inside paragraphs what puts me off. It doesn't happen with the current mono font or Söhne Mono.

Copy link
Copy Markdown
Member

@aarongarciah aarongarciah Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit hacky, but adding vertical-align: 0.02em to inline code tags seems to align them properly. @vladmoroz any better ideas on how to solve the alignment?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing the same with the current font where the x-height is about 0.5px smaller:

image

But overall don't think it's a problem, vertical-align: 0.02em makes the baseline misaligned which sticks out much more to me.

It's always tough to balance monospace and sans-serif fonts when used together inline, have never seen it work perfectly. The monospace is either much wider than sans-serif, or has to be condensed as hell, becoming unreadable. That's why I prefer to bring down the size of the monospace via size-adjust to make the width difference acceptable

}

@font-face {
font-family: Inconsolata;
font-weight: normal;
src: local('Inconsolata-Regular');
size-adjust: calc(100% * 15.75 / 14);
}

@font-face {
font-family: Inconsolata;
font-weight: bold;
src: local('Inconsolata-Bold');
size-adjust: calc(100% * 15.75 / 14);
}
2 changes: 1 addition & 1 deletion docs/src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
--color-red-800: var(--color-red);

/* Typography */
--font-mono: 'SF Mono', 'Menlo', 'DejaVu Sans Mono', 'Consolas', 'Inconsolata', monospace;
--font-mono: 'Paper Mono', monospace;
--font-sans: 'Die Grotesk A', system-ui, sans-serif;
--font-sans-b: 'Die Grotesk B', system-ui, sans-serif;
--font-serif: Georgia, 'Times New Roman', Times, 'Noto Serif', 'DejaVu Serif', serif;
Expand Down
3 changes: 1 addition & 2 deletions docs/src/css/theme-redesign.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
--font-sans-b:
'die grotesk b', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', arial,
sans-serif;
--font-mono:
'Söhne Mono', 'SF Mono', Menlo, 'DejaVu Sans Mono', Consolas, Inconsolata, monospace;
--font-mono: 'Paper Mono', monospace;
--font-serif: Georgia, 'Times New Roman', Times, 'Noto Serif', 'DejaVu Serif', serif;

/* Font size */
Expand Down
Loading