Skip to content

Commit

Permalink
feat(module): add colorMode option
Browse files Browse the repository at this point in the history
Resolves #3143
  • Loading branch information
benjamincanac committed Jan 24, 2025
1 parent c7f64b6 commit d2ceead
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export interface ModuleOptions {
*/
global?: boolean

/**
* @default true
*/
colorMode?: boolean

safelistColors?: string[]
/**
* Disables the global css styles added by the module.
Expand All @@ -61,6 +66,7 @@ export default defineNuxtModule<ModuleOptions>({
},
defaults: {
prefix: 'U',
colorMode: true,
safelistColors: ['primary'],
disableGlobalStyles: false
},
Expand All @@ -83,7 +89,9 @@ export default defineNuxtModule<ModuleOptions>({
// Modules

await installModule('@nuxt/icon')
await installModule('@nuxtjs/color-mode', { classSuffix: '' })
if (options.colorMode) {
await installModule('@nuxtjs/color-mode', { classSuffix: '' })
}
await installTailwind(options, nuxt, resolve)

// Plugins
Expand Down

0 comments on commit d2ceead

Please sign in to comment.