Skip to content

Commit 1de9d1a

Browse files
authored
Antialias text but not code/pre elements (#2747)
1 parent 0e601e2 commit 1de9d1a

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.changeset/clever-mangos-explode.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Apply antialiasing on any text that are not code inline/blocks to avoid contrast issues

packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ export async function CustomizationRootLayout(props: {
160160
fontNotoColorEmoji.className,
161161
`${fonts[customization.styling.font].className}`,
162162
`${ibmPlexMono.variable}`,
163-
'antialiased',
164163
'bg-light',
165164
'dark:bg-dark',
166165
)}

packages/gitbook/src/components/RootLayout/globals.css

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@apply leading-relaxed;
2424
}
2525
body {
26-
@apply text-dark dark:text-light;
26+
@apply text-dark dark:text-light antialiased;
2727
}
2828
html {
2929
@apply gutter-stable;
@@ -54,6 +54,12 @@
5454
@apply outline-2 outline-primary/6;
5555
}
5656

57+
code,
58+
pre {
59+
/* Don't apply antialiased to `code` and `pre` elements */
60+
@apply subpixel-antialiased;
61+
}
62+
5763
/* Light mode */
5864
::-webkit-scrollbar {
5965
@apply bg-dark/1;

0 commit comments

Comments
 (0)