The active class in Vuetify does not get activated when the Color attribute is specified

Having trouble assigning an active class to the chosen V-Card element when a Color Attribute is specified:

For instance:

<v-col v-for="data in datas" :key="data.id">
<v-card
  style="height: 10vh;"
  flat
  dark
  color="green" // <--- The selectedItem Class doesn't work when this is set
  @click="doSomething(), activeId=data.id"
  :class="{ 'selectedItem' : activeId === data.id}"
>
{{ data.id }}
</v-card>

<style scoped>
.selectedItem {
  background-color: blue !important;
}
</style>

The selectedItem Class functions properly when the color attribute is absent and the background is white!

What could be causing this issue?

Answer №1

Utilizing the color attribute in Vuetify results in the application of background-color in CSS with a higher level of specificity compared to the class currently being implemented. To observe this behavior, you can inspect the output.

Due to the fact that color will implement its style using .v-application as the parent selector, if you desire to override this in your stylesheet, you can do so by:

.v-application .selectedItem {
 background: blue !important
}

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

What are the methods used by Optimizely and Visual Website Optimizer to manage visual DOM editing?

Optimizely and Visual Website Optimizer are two innovative platforms that enable users to easily conduct A/B Testing. One standout feature is their visual DOM editing capability, which allows users to visually alter a webpage and save the modifications fo ...

Create a list of items that are enclosed within a parent element

My menu is generated from a php query and the output is as follows: #ultra-menu { width: 92%; background-color: rgba(255, 255, 255, 0.90); position: absolute; left: 0px; right: 0px; margin: auto; border-radius: 35px; max-height: 300px; ...

Is it possible to operate a mobile site automatically alongside a desktop site?

I'm currently working on a website that looks fantastic on desktop, but doesn't quite function properly when viewed on mobile devices. I'm curious if there is a method or system I could implement to automatically load the mobile version of t ...

What causes the focus to be lost when hovering over the second item in the sub list

Link to Fiddle: https://jsfiddle.net/n3tzbn4o/3/ Snippet of CSS: /* Styling for Menu element */ .menu { position: relative; z-index: 100; height: 40px; width: 100%; } Whenever the cursor hovers over Menu 3 > '2015' > Assesmen ...

What could be the reason behind my alert message not showing up when the user fails to login correctly? Exploring Django, HTML, and CSS for answers

Below is the code snippet from my signIn.html file: {% if messg %} <script> aleart("{{messg}}"); </script> {% endif %} Here is a snippet of my Django View code: def postsign(request): email = request.POST.get("email" ...

"422 (Unprocessable Entity) Error When Submitting a Form in Rails Application

I recently delved into the world of ruby on rails a few days back. My current challenge involves transferring data from html tags to a ruby function using ajax. Below is the error message that has been giving me trouble: POST http://localhost:3000/ajax/o ...

Is there a way to bypass the initial result when using document.querySelectorAll?

this is my own unique html content <div class="content-body"> <table style="text-align:center;" class="table table-bordered"> <tbody> <tr> <th>Text Line</th> </tr> <tr> <td> ...

Adjust THREE.PerspectiveCamera's distance without altering its viewing orientation

I have a PerspectiveCamera in THREE.js positioned somewhere in space as a child of a mesh. The camera is currently looking at the mesh with local coordinates [0, 0, 0]. I am looking for a way to change the distance of the camera from the mesh without chang ...

Angular is programmed to detect any alterations

Upon detecting changes, the NgOnChanges function triggers an infinite service call to update the table, a situation that currently perplexes me. Any assistance on this matter would be greatly appreciated. Many thanks. The TableMultiSortComponent functions ...

Retrieve items from the parent row of selected checkboxes

Within my table, I have the following row. <tr class="data_rows" ng-repeat='d in t2'> <td class="tds"> <input class='checkBoxInput' type='checkbox' onchange='keepCount(this)'></td> &l ...

The favorite icon is not functioning properly in the index.html file while using Vue.js

Why doesn't the favorite icon display in the file index.html in my vue.js project, even though the path is correct? <meta charset="utf-8"> <link rel="icon" href="./src/assets/images/logo.png" type="image/png" sizes="96x96"> <me ...

Troubleshoot the reason behind the malfunctioning Console log on the website

I have been troubleshooting why console.log is not printing anything. I have tried defining and enabling debugger mode, but nothing seems to work. https://i.sstatic.net/5clXf.png Check out the website here: Any suggestions on how I can resolve this issu ...

After a successful transactWrite operation using DynamoDB.DocumentClient, the ItemCollectionMetrics remains unpopulated

Currently, I am utilizing a transactWrite instruction to interact with DynamoDb and I am expecting to receive the ItemCollectionMetrics. Even though changes have been made on the DynamoDb tables, the returned object is empty with {}. Does anyone have any ...

Are Javascript's JSON.stringify and PHP's json_encode equivalent functions?

When attempting to hash stringified data using HMAC SHA256 in both JavaScript (with CryptoJS Libraries) and PHP (using the built-in HMAC function), I am concerned about potential inconsistencies between JavaScript's JSON.stringify and PHP's json_ ...

Converting a const function to a regular function in Javascript ES6

Looking to integrate vuexfire for Firebase bindings, the documentation suggests adding the following action for binding const setTodosRef = firebaseAction(({ bindFirebaseRef, unbindFirebaseRef }, { ref }) => { // Binding will automatically unbind any ...

Storing a collection of objects in session storage

I've been struggling to save an array containing the items in my online shopping cart. Even though both the object and the array are being filled correctly, when I check the sessionStorage, it shows an array with an empty object. I've spent a lot ...

Node.js client-side code

Hi all, I am currently exploring Nodejs and experimenting with setting up a server-client connection using sockets. The server side seems to be functioning properly, but I am encountering some difficulties with the client side connection. I would appreciat ...

What are the potential causes of receiving the error message "No Data Received ERR_EMPTY_RESPONSE"?

I often encounter this issue on my website, especially when I have a thread open. It seems to happen whenever I am actively checking for new posts and notifications via Ajax every 10 seconds or so. However, I'm not sure if this continuous reloading is ...

Initiate file selection on Ionic 4 following a change in page

I am looking to activate/open a file input that is from another page within Ionic 4. On page 1, I have a button that leads to a modal. Inside the modal page, I want to automatically initiate the <input file> dialog. Component ionViewWillEnter() { ...

How can I resolve the issue of <td> being repeatedly displayed five times instead of just twice in PHP?

Can someone assist me with fixing this for loop issue? I am trying to display controls next to each item in the row, but it is showing 5 sets of controls instead of just 2. <tbody> <?php //retrieve list of supplies $numOfRows = 0; $result = my ...