From 8c1e59e3b2895d7f192920f02b9b76c3e34bfa64 Mon Sep 17 00:00:00 2001 From: ygkn Date: Sun, 18 Jun 2023 15:47:30 +0900 Subject: [PATCH] NextJS: fix not loading fonts has 3 (or more) words name --- .../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;