feat: add DaisyUI for easy components styling and dark mode handling

This commit is contained in:
Florian Briand 2024-09-23 17:45:08 +02:00
parent bc33bd48e8
commit 2e057eee01
Signed by: florian_briand
GPG Key ID: CC981B9E6B98E70B
4 changed files with 17 additions and 1 deletions

Binary file not shown.

View File

@ -6,6 +6,7 @@ export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
'@nuxtjs/tailwindcss',
'@nuxtjs/color-mode',
],
// Disable SSR for Tauri
ssr: false,
@ -28,5 +29,11 @@ export default defineNuxtConfig({
port: 5183,
},
},
}
},
colorMode: {
// Add `data-theme` attribute to the `html` tag, allowing DaisyUI to handle dark mode automatically
dataValue: 'theme',
// Remove the default `-mode` suffix from the class name, letting have `dark` and `light` as class names, for DaisyUI compatibility
classSuffix: '',
},
})

View File

@ -10,6 +10,8 @@
"postinstall": "nuxi prepare"
},
"dependencies": {
"@nuxtjs/color-mode": "^3.5.1",
"daisyui": "^4.12.10",
"nuxt": "^3.13.0",
"vue": "latest",
"vue-router": "latest"

View File

@ -0,0 +1,7 @@
import type { Config } from 'tailwindcss'
export default <Partial<Config>>{
plugins: [
require('daisyui'),
],
}