From 1bf2899dd04a1a69a62cce78074e099b9dcb3d82 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 19 Jun 2023 10:11:09 +0200 Subject: [PATCH] Merge pull request #23121 from ygkn/next-font-fix-not-loading-fonts-has-3-words-name NextJS: fix not loading fonts has 3 (or more) words name (cherry picked from commit 0d7c3a8971525645039ece89c8e931ddb2cbb97a) --- .../nextjs/src/font/webpack/loader/utils/get-css-meta.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts b/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts index aa816e05faf4..7be59c01c486 100644 --- a/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts +++ b/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts @@ -37,7 +37,7 @@ export function getCSSMeta(options: Options) { } function getClassName({ styles, weights, fontFamily }: Options) { - const font = fontFamily.replace(' ', '-').toLowerCase(); + const font = fontFamily.replaceAll(' ', '-').toLowerCase(); const style = isNextCSSPropertyValid(styles) ? styles[0] : null; const weight = isNextCSSPropertyValid(weights) ? weights[0] : null;