Skip to content

Commit

Permalink
fix: darkMode tailwindcss config check (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
winchesHe authored Nov 12, 2024
1 parent 654349e commit 294a886
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/helpers/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ export function checkTailwind(
if (type === 'all') {
// Check if the required content is added Detail: https://nextui.org/docs/guide/installation#global-installation
const darkMatch = getMatchArray('darkMode', tailwindContent);
const isDarkModeCorrect = darkMatch.some((darkMode) => darkMode.includes('class'));
// Some tailwind.config.js use darkMode: 'class' not darkMode: ['class']
const isDarkModeCorrect =
darkMatch.some((darkMode) => darkMode.includes('class')) ||
/darkMode:\s*["'`]class/.test(tailwindContent);
const isContentCorrect = contentMatch.some((content) =>
content.includes(tailwindRequired.content)
);
Expand Down

0 comments on commit 294a886

Please sign in to comment.