Change the text color of the Vuetify button to customize its appearance

Is there a way to change the default active color for button text in a toolbar using CSS?

v-btn(:to="item.path" active-class="v-btn--active toolbar-btn-active") {{item.meta.title}}

I attempted to override it with this custom class:

.toolbar-btn-active {
  background-color: white;
  &::before {
    background-color: white;
  }
  .v-btn__content {
    color: red !important;
   }
}

However, only the background color is being changed. How can I update the button text color as well?

This is what the HTML looks like:

<a href="/document" class="v-btn v-btn--active toolbar-btn-active">
           <div class="v-btn__content">Document</div>
</a>

Answer №1

v-btn--active is the default active class, but it can be changed using the active-class property.

We are able to target the active-class and adjust the CSS as follows:

.v-btn--active .v-btn__content { 
  color: red 
}  

It is important to note that in scoped styles, we must utilize deep selectors like so:

>>> .v-btn--active .v-btn__content

Answer №2

To modify a specific button in HTML, you can simply add a class to the v-btn element.

<v-btn class="custom-button">Button</v-btn>

<style>
.custom-button {
  color: green !important;
  background-color: orange !important;
}
</style>

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

Using axios to pass parameters in a post request

In my webpack project, I am currently using vue-resource for ajax calls. Everything works perfectly with "get" calls, but when I try a post request, my PHP file does not receive any parameters. Even when I use var_dump($_POST), it just gives me an empty ar ...

The CSS properties of a div element include the :before pseudo-element with a "shape" style that does

Having trouble finding a way to neatly contain this circle inside the div without any overflow. Looking for an elegant solution! Example of desired outcome .wrapper{ background: #efefef; height: 250px; } .wrapper::before{ width: 300px; height: 300 ...

Establishing a class for wp_nav_menu

Is there a way to transform the following code: <ul class="ulStyle"> <li class="liStyle"> <div class="first"> <div class="second"> menu1 </div> </div> </li> </ul> into wp_nav_menu? I'm struggling with ...

What is the best way to send back a 401 error along with a personalized message?

I have encountered an AuthenticationException in my Web API while using the DoCdssLoginTests(...) method. When this exception is caught, I am currently returning a 401 error response, but I would like to include a custom message with it. Unfortunately, th ...

Exploring the Potential of JSP in Form Submissions

Here's a OCWCD question that I encountered: <form action="sendOrder.jsp"> <input type="text" name="creditCard"> <input type="text" name="expirationDate"> <input type="submit"/> </form> The question based on the ...

What are the steps to retrieving information in Vue 3?

I'm encountering an issue with fetching data using Vue 3. I've set up an action to call an endpoint (), but I'm not receiving any response data. The defined endpoint is as follows: import { createStore } from 'vuex' export d ...

My DIV is not floating to the right as expected. What could be the issue?

I'm having trouble positioning the timer to float on the right top side of the logo. Even though using the regular style="float:right" works perfectly... <div id="whole_page" /> <div id="header" /> <?php echo " ...

Excessive size of bootstrap form

I'm currently working on designing a form within a section that has a width of col-sm-8. The form consists of three columns: label, text input, and username check. I've designated the label to have a width of col-sm-2, the username check to have ...

"VS Code's word wrap feature is beneficial for wrapping long lines of text and code, preventing them from breaking and ensuring they are

text not aligning properly and causing unnecessary line breaks insert image here I attempted to toggle the word wrap feature, installed the Rewrap plugin, and played around with vscode settings ...

Is there a setting causing Webpack to not rebuild when there are changes to the CSS?

I have configured postcss-loader and style-loader on webpack, and I am using webpack-dev-server. However, every time I make changes to the CSS, webpack does not rebuild automatically. The script for webpack dev server that I use in npm scripts: webpack-d ...

Verify the input in text fields and checkboxes using JavaScript

I'm in the process of creating a complete "validate-form" function, but there are still a couple of things missing: Ensuring that the Name field only allows alphabetical characters and white spaces Validating that at least one checkbox is selected, ...

The resizing issue of Textarea during transitions

Whenever I add the transition property to a textarea, it automatically affects the resizing function of the textarea. Is it possible to disable the transition only when resizing the textarea, but not for the textarea itself? <textarea name="" id="" cla ...

AngularJS dropdown not reflecting changes when using ng-selected

While working with AngularJS, I have encountered an issue where the first child of the select element remains empty despite my efforts to populate it. Below is the HTML code snippet: <select id="connectTV" aria-label="How many Dish TVs" ng-model="conn ...

Exporting MySQL data to MS Excel is functioning smoothly on the local environment, however, it is encountering difficulties when

<title>Orders Export</title> <body> <?php header('Content-Type: application/xls'); header('Content-Disposition: attachment; filename=download.xls'); $con = mysqli_connect('localhost','suresafe ...

Is it possible for me to create a list in alphabetical order beginning with the letter B instead of A

My task involves creating a summary of locations using the Google Maps API. The map displays letters corresponding to different waypoints, and I have a separate <div> containing all the route information. Currently, I have the route information stru ...

Troubleshooting a Hover Problem in Firefox

Chrome is rendering the following code perfectly fine, but Firefox seems to be having trouble applying the hover effect. HTML <!DOCTYPE html> <html> <head> <link type="text/css" rel="stylesheet" href="stylesheet.css"/> ...

Which element to use for creating a color palette - <img>, <div>, or <canvas>?

I am currently in the process of developing a color-picker component using HTML, CSS, and Javascript. One key question that I have is how to best implement a color palette similar to the one below: Putting aside browser compatibility concerns with IE8 or ...

Replicate the styling of CSS class A and apply it to class B

Let's take a look at some code: <button id="test" class="ui-state-hover" value="Button"> In Context: I'm utilizing the JQuery UI CSS class ui-state-hover on an HTML button to ensure it always appears as if it's being hovered over. H ...

Two Vue.js components accessing shared data retrieved from a service call

Currently, I am working with two Vue components. The first component is connected to the Data Store in order to retrieve the necessary data for binding. This component is responsible for displaying multiple details (records). The second component also requ ...

display the chosen choices from the jquery tool

I have implemented a Jquery movie seat selection plugin on my jsp website successfully. It allows users to select seats with ease. However, the issue I am facing is that due to my limited knowledge of Jquery, I am unable to display the selected seats by t ...