Vuetify how to add custom theme

Pathum Kalhan

I used vue cli3 to create my project.

vue create my-project

then I add vuetify to my project.

vue add vuetify

then after I created a custom theme from vuetify theme generator. now I want to add that theme to my project.

In the official documentation of vuetify adding a theme is like this

    Vue.use(Vuetify, {
  theme: {
    primary: '#3f51b5',
    secondary: '#b0bec5',
    accent: '#8c9eff',
    error: '#b71c1c'
  }
})

But my main.js looks like this

import '@babel/polyfill'
import Vue from 'vue'
import './plugins/vuetify'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
  render: h => h(App)
}).$mount('#app')

In here there is nothing called Vuetify. So how can I add a custom theme in this project setup?

ValDaHus

You are using vue-cli 3 here :) Look at your project, there is a folder called: plugins.

src >> plugins

In this folder you will find vuetify.js, here you can just specify the theme you want to use as the documentation says.

import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'

Vue.use(Vuetify, {
    theme: {
        primary: "#f44336",
        secondary: "#e57373",
        accent: "#9c27b0",
        error: "#f44336",
        warning: "#ffeb3b",
        info: "#2196f3",
        success: "#4caf50"
      }
})

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to enable dark mode with custom colors in light theme in vuetify?

How to add custom item in android Theme declaration?

How can we add wpform to custom theme

How to add custom theme to Ionic 5 application?

How to add new font to custom magento theme?

how to add a logo on custom wordpress theme

How to modify Vuetify default theme?

Cannot create custom vuetify theme colors

How to add custom validation which calls an API in vuetify forms?

How to add a gradient color in daisyui custom theme colors?

How to theme add/edit form for custom content type in drupal 7

How to add search box with icon in custom wordpress theme without plugins

How do you add an image to the custom theme itself in wordpress?

How to add a custom social media icon to the Twenty Twenty theme?

Vuetify: How to get current theme color?

How to add custom theme features of post into custom post type? Wordpress, php

Vuetify, How to custom-filter

Add custom numbering to Vuetify datatable rows

Can I add custom translations to Vuetify datepicker?

How to define custom routes in theme?

How to create a custom theme for QtCreator

How to run a custom theme on Streamlit?

Add custom font via CSS to Wordpress theme

Add custom theme variable object to createMuiTheme()

Add a Submenu from Another Submenu in a Custom Theme

Add custom php file in child theme WP

Custom WordPress Theme - Menus will not add to nav

How to apply custom theme to google custom search?

How do I add back the transparent background around my dialog activity with a custom theme