diff --git a/exampleSite/tailwind-plugin/tw-theme.js b/exampleSite/tailwind-plugin/tw-theme.js index 70b0a28..230a0f3 100644 --- a/exampleSite/tailwind-plugin/tw-theme.js +++ b/exampleSite/tailwind-plugin/tw-theme.js @@ -51,11 +51,22 @@ module.exports = plugin.withOptions(() => { const groups = [ { colors: themeConfig.colors.default.theme_color, prefix: "" }, { colors: themeConfig.colors.default.text_color, prefix: "" }, - { - colors: themeConfig.colors.darkmode.theme_color, - prefix: "darkmode-", - }, - { colors: themeConfig.colors.darkmode.text_color, prefix: "darkmode-" }, + ...(themeConfig.colors.darkmode?.theme_color + ? [ + { + colors: themeConfig.colors.darkmode.theme_color, + prefix: "darkmode-", + }, + ] + : []), + ...(themeConfig.colors.darkmode?.text_color + ? [ + { + colors: themeConfig.colors.darkmode.text_color, + prefix: "darkmode-", + }, + ] + : []), ]; // Set color variables