How To change theme colors on Nuxt/Vuetify starter template

后端 未结 2 1657
青春惊慌失措
青春惊慌失措 2020-12-18 01:02

Change colors

I\'m trying to use Vue with Nuxt and Vuetify for the styles, on Vuetify exists many templates, one of them brings all.

I tried to add colors

相关标签:
2条回答
  • 2020-12-18 01:22

    There are two options to change the color theme 1. from the /plugins/vueitfy.js

        Vue.use(Vuetify, {
      theme: {
        primary: '#2c3e50',
        secondary: '#1abc9c',
        accent: '#2980b9',
        error: '#e74c3c',
        action: '#23DB2A'
      }})
    
    1. From /assets/style/appl.styl, before the require of vuetify

    $theme := { primary: '#2c3e50', secondary: '#1abc9c', accent: '#2980b9', error: '#e74c3c', action: '#23DB2A' }

    And header and footer won't work as a color theme property

    0 讨论(0)
  • 2020-12-18 01:29

    In Vuetify 2, for example, if you want ro override background colour (nuxt js):

    1. Create .\assets\style\variables.scss
        @import '~vuetify/src/styles/styles.sass';
    
        $material-light: map-merge($material-light, (
                background: map-get($blue, 'lighten-5'),
                calendar: (background-color: red),
        )
        );
    
    1. In nuxt.config.js add:
        import colors from 'vuetify/lib/util/colors'
    
    
        buildModules: ['@nuxtjs/vuetify'],
        vuetify: {
            treeShake: true,
            customVariables: ['~/assets/style/variables.scss']
            theme: {
                options: {customProperties: true},
                themes: {
                    light: {
                        primary: colors.blue.lighten5,
                        secondary: colors.amber.darken3,
                        accent: colors.grey.darken3,
                        info: colors.teal.lighten1,
                        warning: colors.amber.base,
                        error: colors.deepOrange.accent4,
                        success: colors.green.accent3
                    }
        }
    

    More info:

    1. https://vuetifyjs.com/ru/customization/sass-variables

    2. https://vuetifyjs.com/ru/customization/theme

    0 讨论(0)
提交回复
热议问题