diff --git a/.changeset/perfect-boxes-grow.md b/.changeset/perfect-boxes-grow.md new file mode 100644 index 000000000..8317f30d6 --- /dev/null +++ b/.changeset/perfect-boxes-grow.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Fix emojis display diff --git a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx index 05475df6d..e16173495 100644 --- a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx +++ b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx @@ -11,13 +11,12 @@ import assertNever from 'assert-never'; import colorContrast from 'postcss-color-contrast/js'; import colors from 'tailwindcss/colors'; -import { fonts, ibmPlexMono } from '@/fonts'; +import { fontNotoColorEmoji, fonts, ibmPlexMono } from '@/fonts'; import { getSpaceLanguage } from '@/intl/server'; import { getStaticFileURL } from '@/lib/assets'; import { hexToRgb, shadesOfColor } from '@/lib/colors'; import { tcls } from '@/lib/tailwind'; -import { emojiFontClassName } from '../primitives'; import { ClientContexts } from './ClientContexts'; import '@gitbook/icons/style.css'; @@ -154,7 +153,7 @@ export async function CustomizationRootLayout(props: { tag to use the emoji font. - */ -export const emojiFontClassName = [colrv1Font.variable, sbixFont.variable, cbdtFont.variable].join( - ' ', -); - /** * Render an emoji by its codepoint. * It renders the UTF-8 character and use the emojione font to display it (fallbacking to default browser font). diff --git a/packages/gitbook/src/components/primitives/Emoji/joypixels-cbdt.woff2 b/packages/gitbook/src/components/primitives/Emoji/joypixels-cbdt.woff2 deleted file mode 100644 index d663b448d..000000000 Binary files a/packages/gitbook/src/components/primitives/Emoji/joypixels-cbdt.woff2 and /dev/null differ diff --git a/packages/gitbook/src/components/primitives/Emoji/joypixels-colrv1.woff2 b/packages/gitbook/src/components/primitives/Emoji/joypixels-colrv1.woff2 deleted file mode 100644 index f7a4bd519..000000000 Binary files a/packages/gitbook/src/components/primitives/Emoji/joypixels-colrv1.woff2 and /dev/null differ diff --git a/packages/gitbook/src/components/primitives/Emoji/joypixels-sbix.woff2 b/packages/gitbook/src/components/primitives/Emoji/joypixels-sbix.woff2 deleted file mode 100644 index b5e8eb0b6..000000000 Binary files a/packages/gitbook/src/components/primitives/Emoji/joypixels-sbix.woff2 and /dev/null differ diff --git a/packages/gitbook/src/fonts/index.ts b/packages/gitbook/src/fonts/index.ts index 42d0fbf38..3bec43cd2 100644 --- a/packages/gitbook/src/fonts/index.ts +++ b/packages/gitbook/src/fonts/index.ts @@ -15,9 +15,17 @@ import { Roboto_Slab, Source_Sans_3, Ubuntu, + Noto_Color_Emoji, } from 'next/font/google'; import localFont from 'next/font/local'; +export const fontNotoColorEmoji = Noto_Color_Emoji({ + variable: '--font-noto-color-emoji', + weight: ['400'], + preload: false, + display: 'swap', +}); + /* Fonts are downloaded and loaded by next/font.