diff --git a/.changeset/clever-mangos-explode.md b/.changeset/clever-mangos-explode.md new file mode 100644 index 000000000..21a2cfa20 --- /dev/null +++ b/.changeset/clever-mangos-explode.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Apply antialiasing on any text that are not code inline/blocks to avoid contrast issues diff --git a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx index 08db8645f..03e341c71 100644 --- a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx +++ b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx @@ -160,7 +160,6 @@ export async function CustomizationRootLayout(props: { fontNotoColorEmoji.className, `${fonts[customization.styling.font].className}`, `${ibmPlexMono.variable}`, - 'antialiased', 'bg-light', 'dark:bg-dark', )} diff --git a/packages/gitbook/src/components/RootLayout/globals.css b/packages/gitbook/src/components/RootLayout/globals.css index 961a58fe6..1f7a4b2ab 100644 --- a/packages/gitbook/src/components/RootLayout/globals.css +++ b/packages/gitbook/src/components/RootLayout/globals.css @@ -23,7 +23,7 @@ @apply leading-relaxed; } body { - @apply text-dark dark:text-light; + @apply text-dark dark:text-light antialiased; } html { @apply gutter-stable; @@ -54,6 +54,12 @@ @apply outline-2 outline-primary/6; } + code, + pre { + /* Don't apply antialiased to `code` and `pre` elements */ + @apply subpixel-antialiased; + } + /* Light mode */ ::-webkit-scrollbar { @apply bg-dark/1;