Update the text and background colors of all Vuetify components

Hey everyone, I'm trying to figure out how to change the text and background colors of all Vuetify components. I've tried using a custom theme but it's not working as expected. Any suggestions?

:)

const myCustomLightTheme = {
    dark: false,
    colors: {
        background: "#FFFFFF",
        surface: "#FF0000",
        primary: "#FF0000",
        "primary-darken-1": "#FF0000",
        secondary: "#03DAC6",
        "secondary-darken-1": "#018786",
        error: "#B00020",
        info: "#2196F3",
        success: "#4CAF50",
        warning: "#FB8C00"
    }
};

const vuetify = createVuetify({
    components,
    directives,
    theme: {
        defaultTheme: "myCustomLightTheme",
        themes: {
            myCustomLightTheme
        }
    }
});

Answer №1

You have overlooked the entry for on-background (as well as probably on-primary, on-surface, and so on):

const myCustomLightTheme = {
  dark: false,
  colors: {
    ...,
    'on-background': '#00f00f',
    'on-primary': '#ff0',
  },
}

Utilize the inspector tool to identify which variable is being utilized. The screenshot shows that the text color on the input is determined by the --v-theme-on-background variable:

(The prefix v-theme- is added by Vuetify, with the corresponding variable being on-background)

Here it is in a playground

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Retrieve Vuejs template by either module or ID

In my .Vue file, I have defined a template along with its subcomponents with the intention of allowing customers to override this template without needing to modify any javascript code. If there exists an element with id="search-result", then that element ...

Showcasing the time variance using javascript/jquery

I am currently using a datepicker to select dates, with the intention of calculating the difference between the chosen dates and then displaying an alert with the calculated difference. Unfortunately, I am encountering issues with getting the code to work ...

What could be the reason why I am unable to load the ejs file?

https://i.stack.imgur.com/91bPg.png Issue: Unable to find the "index.ejs" view in the views directory ...

Leveraging database functionality through sequelize

I'm a beginner in Express and I want to learn how to create a "Select *" query on a table. I know that I need to create a model of the table in a .js file and I have a good understanding of the next steps. However, my question is: How can I create a ...

I am unable to pass the req.params.id value as an input to a function located in a separate file

In my project, I've developed a REST API for user and coupon management. The main file driving this API is called coupon-api.js. This file contains the route definitions, while the functions to handle these routes are separated into two distinct files ...

Having trouble with my Vuejs and Vuetify custom theme and icons implementation - need help!

I have gone through all the previous inquiries, and it seems that the new update of Vuetify is causing issues with my custom themes and icons not displaying properly. "vuetify": "^2.1.11", Here is a snippet from my vuetify.js file: import Vue from &apos ...

When using Mongoose's save function within an async.each loop, it may

While working on an array processing task that involves saving and validating data asynchronously, I encountered an issue with duplicates. Here is the data I'm currently processing: var guests = [{ "email": "<a href="/cdn-cgi/l/email-protection" ...

Removing an Element According to Screen Size: A Step-by-Step Guide

Currently, I am facing a dilemma with two forms that need to share the same IDs. One form is designed for mobile viewing while the other is for all other devices. Despite using media queries and display: none to toggle their visibility, both forms are stil ...

Using a custom attribute in jQuery allows conditional statements to be executed using the

I have been attempting to create an if/else statement in jQuery using a custom attribute called "data-id". I decided to name it this way because I thought I could utilize the .data() method in jQuery, but unfortunately, it did not work as expected. Below ...

Removing a specific MySQL row using HTML in collaboration with Node.js

I've been working on a feature to allow users to delete specific rows from a table. Each row has a "Delete" link at the end, but when I click it, nothing happens. There are no errors displayed, and the console shows that 0 row(s) have been updated, ye ...

Optimal method for updating language-specific content received from APIs

Scenario: In my Vuejs SPA, I have successfully implemented localization on both frontend and backend. The content updates seamlessly without needing to reload the page when switching languages. Issue: However, certain contents l ...

Vue's mounted method seems to be holding back on providing the $route.name

After spending a full day diving into Vue and familiarizing myself with all the hooks and routes, I still can't seem to get the desired result. I've tried using the regular hooks like created and mounted, but it continues to return null. Here is ...

Execute and showcase code without redundancies

I have been exploring a way to store JavaScript code within an object and execute specific parts of it upon the user clicking a button. Here's what I've come up with so far: var exampleCode = { test: "$('body').css('background ...

What might prevent an onSubmit event from triggering the execution of "checkTheForm()"?

Despite consuming a substantial amount of information on the internet, I still find myself puzzled by why my code isn't functioning as expected. I acknowledge that there are numerous tutorials out there guiding me to use <form action="index.html" o ...

Unveiling the Mystery: Uncovering the Selected Item in Ionic Checkboxes

I am trying to implement a feature in Ionic checkboxes where I can get the selected item when a user checks one or more checkboxes. Specifically, I want to identify which books the user has selected. Below are snippets of my code: <ion-item ng ...

What are some methods for submitting an HTML form to a CSV file?

I've been racking my brain for the past few days trying to find a viable solution to this problem. My project requires 100 individuals to take turns sitting at a computer and filling out a form I created. Each time someone submits their information, ...

Is it possible for me to access and observe the children attribute within the $ref reference

Is it possible to listen for changes to the children property of an element if the element renders its children later and I have a reference to the element? <element ref="parent"> <child-to-be-loaded-later /> </element> ...

unable to assign values to this.props (appears as undefined or an empty array)

Upon setting up react/redux, I encountered a peculiar issue. When my component mounts, it should render the information stored in this.props.heroes.data. However, upon logging this data, I receive an unexpected value of [{id:1,heroname:'Batman',r ...

What could be causing the issue when attempting to run "npm run serve"?

Can anyone help me understand this error message and suggest a possible solution? Failed to compile. ./src/main.js Module build failed (from ./node_modules/eslint-loader/index.js): Error: No ESLint configuration found. at Config.getLocalConfigHierar ...

Rewrite the nginx configuration to eliminate the "/index.html" part of the URL while preserving the query

My Nginx configuration specifies index index.html as the default index page. When accessing it as a progressive web app (using Angular), the URL loads as /index.html#/route instead of /#/route for some reason. I want to: Check if the URL contains ...