Nuxt.js: Vuetify custom theme ignored by Nuxt

Created on 8 Jul 2019  路  12Comments  路  Source: nuxt/nuxt.js

Version

v2.6.0

Reproduction link

https://github.com/nuxt/nuxt.js/issues/

Steps to reproduce

I am using Nuxt.js with Vuetify.js where I want to change the default theme colors.

I created a file: ~/plugins/vuetify.js to change the default primary color to red.

Here is its content:

import Vue from 'vue'
import Vuetify from 'vuetify'

Vue.use(Vuetify, {
  theme: {
    primary: '#ff0000'
  }
})

In nuxt.config.js I asked Nuxt.js to use this plugin:

export default {
  plugins: ['~/plugins/vuetify']
}

What is expected ?

Calling primary must render the red color

What is actually happening?

The default primary color #1976d2 is displayed

Additional comments?

This is true maybe in whatever Nuxt.js version you use.

This bug report is available on Nuxt community (#c9463)
bug-report question

All 12 comments

Please try with the vuetify module instead of your custom plugin: https://github.com/nuxt-community/vuetify-module/

I resolved the problem, it was not a bug.
I posted the solution on StackOverflow
Hope this can be useful for someone else in the future.
Thank you

@begueradj I also have the same problem what was your solution?

Same here, the solution link is broken.

@Alecell Indeed, sorry ... I noticed in newer Nuxt versions, you can control that in nuxt.config.js file which is in the root directory of your project

@masterDoomX Sorry for the late reply, please just open nuxt.config.js, scroll down until you see what you are looking for.

@begueradj

Try this. I was in the same problem and solved it this one :)

vuetify: { theme: { themes:{ light:{ primary: '#ff9f1a' } } } },

I refer to the link,
https://vuetifyjs.com/ko/customization/theme

I using @nuxt/vuetify

then on my nuxt.config.js
buildModules: [ '@nuxtjs/vuetify', ], vuetify: { customVariables: ['~/assets/variables.scss'], theme: { dark: false, themes: { light: { primary: '#5398d9', } } } }

Thank you for sharing @cjg9040

I set theme: disable: true,
still, default theme--lightapplied

I set theme: disable: true,
still, default theme--lightapplied

same, you have find a soluce ?

The docs should have mentioned that you need to envelope the app on tag in the customization section, shouldn't ?

Took me a couple hours to figure out

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pehbehbeh picture pehbehbeh  路  3Comments

surmon-china picture surmon-china  路  3Comments

danieloprado picture danieloprado  路  3Comments

bimohxh picture bimohxh  路  3Comments

VincentLoy picture VincentLoy  路  3Comments