From 0f3b3f1b0bbbe44ab7b4bb26b876f56dec0f188d Mon Sep 17 00:00:00 2001 From: sridharc Date: Fri, 23 Feb 2024 12:48:56 +0530 Subject: [PATCH] Fix duplicate font family values in merged configuration --- packages/material-tailwind-html/utils/withMT.js | 6 ++++-- packages/material-tailwind-react/src/utils/withMT.js | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/material-tailwind-html/utils/withMT.js b/packages/material-tailwind-html/utils/withMT.js index 84eb40197..efaec60ef 100644 --- a/packages/material-tailwind-html/utils/withMT.js +++ b/packages/material-tailwind-html/utils/withMT.js @@ -35,8 +35,10 @@ function withMT(tailwindConfig) { themeFont.serif = serif || themeFont.serif; themeFont.body = body || themeFont.body; } - - return merge(materialTailwindConfig, { ...tailwindConfig }); + + const mergedConfig = merge(materialTailwindConfig, { ...tailwindConfig }); + mergedConfig.theme.fontFamily = themeFont; + return mergedConfig; } module.exports = withMT; diff --git a/packages/material-tailwind-react/src/utils/withMT.js b/packages/material-tailwind-react/src/utils/withMT.js index 97efdcf75..51c22b88f 100644 --- a/packages/material-tailwind-react/src/utils/withMT.js +++ b/packages/material-tailwind-react/src/utils/withMT.js @@ -38,8 +38,9 @@ function withMT(tailwindConfig) { themeFont.serif = serif || themeFont.serif; themeFont.body = body || themeFont.body; } - - return merge(materialTailwindConfig, { ...tailwindConfig }); + const mergedConfig = merge(materialTailwindConfig, { ...tailwindConfig }); + mergedConfig.theme.fontFamily = themeFont; + return mergedConfig; } module.exports = withMT;