Vuetify app won't go dark with custom configuration #16540
Unanswered
craigPeckett
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am trying to use custom configuration in my nuxt app but I can't get the app to go into dark mode.
It works when setting the default theme to 'dark'.
`
import { createVuetify } from "vuetify";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";
export default defineNuxtPlugin((nuxtApp) => {
const vuetify = createVuetify({
components,
directives,
theme: {
defaultTheme: 'dark'
}
});
nuxtApp.vueApp.use(vuetify);
});
`
But when I use custom configuration it changes to light and I can't get it to change.
`
import { createVuetify } from "vuetify";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";
const myCustomLightTheme = {
dark: true,
colors: {
background: "#FFFFFF",
surface: "#FFFFFF",
primary: "#c0c0c0",
"primary-darken-1": "#3700B3",
secondary: "#03DAC6",
"secondary-darken-1": "#18786",
error: "#B00020",
info: "#2196F3",
success: "#4CAF50",
warning: "#FB8C00",
},
};
export default defineNuxtPlugin((nuxtApp) => {
const vuetify = createVuetify({
components,
directives,
theme: {
defaultTheme: "myCustomLightTheme",
themes: {
myCustomLightTheme,
},
},
});
nuxtApp.vueApp.use(vuetify);
});
`
any ideas?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions