Skip to content

Commit

Permalink
feat: themes config can now be array
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed May 13, 2021
1 parent 60c583b commit bf33256
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ const mainFunction = ({ addBase, addComponents, addUtilities, config }) => {
}

// inject themes
if (config('daisyui.themes') != false) {
if (Array.isArray( config('daisyui.themes') )) {
let diasyuiIncludedThemes = []
config('daisyui.themes').forEach(theme => {
addComponents(require("./dist/themes/"+theme))
diasyuiIncludedThemes.push(theme)
});
diasyuiIncludedItems.push('selected themes(' + diasyuiIncludedThemes.length + ')')
}
else if (config('daisyui.themes') != false) {
addComponents(themes)
diasyuiIncludedItems.push('themes')
}
Expand Down

0 comments on commit bf33256

Please sign in to comment.