-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(VListItem): allow default color to change when inactive #13719
Conversation
Should the icon's color change as well maybe? I think it makes more sense |
Yes, but this was intentional so inactive items aren't highlighted (see https://vuetify-lzjyu0p1p-vuetifyjs1.vercel.app/en/getting-started/installation/) |
Okay let me see if I can fix that without an important keyword |
Hmm, doesn't seem to be possible with css only. Basically they should only get the Once the class is removed then this would be enough to avoid color override |
I think to solve this it would make sense to have a |
I removed the color class when the item is not active, which fixes the demonstrated issue Also took the liberty of adding the base-color prop which is the prop that controls the color in any state (with color still overriding this if active) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the naming is confusing. If we have a visual change based upon the state of an item, it should have a name that reflects that.
Personally, I'd rather have the parent dictate a color and active-color and leave v-list-item
alone.
I'm actively working on v3 lists and I'll chime in more as I experiment more.
There does need to be some way to change the colour of an individual item imo |
So just the fix without the base-color prop? |
Can you take a look at |
@johnleider The doc site doesn't seem to include it there https://next.vuetifyjs.com/en/components/application/ any other way to check except building it locally? Did you also add a similar snippet in the doc like: 54f8d4f ? (You can copy it if not, just replace color with activeColor and baseColor with color) |
@Tofandel I'm going to have to revert this, Feel free to open a new PR if you have a solution that works for this case as well. I did try using |
Indeed made a new PR, the onRouteChange should be called on mounted, as for the activeClass to set it back to false no need, you actually just need to call toggle, only if the class boolean is different than the isActive value, effectively trully reflecting isActive on every route change Probably not the best explanation but you'll understand the code I also made sure it doesn't change the behavior of tabs and buttons |
…uetifyjs#13719) This reverts commit 6fb889d. fixes vuetifyjs#14186
Description
Fixes #9285 by removing the !important keyword in the vuetify style sheet
and adding abase-color
propMotivation and Context
It is currently not possible to change the color of a v-list-item via an hex
color="#CCC"
prop, it is only possible to do it via a tricky css rule (needs to be very specific, and the selector with this rule is already too specific with an!important
keyword,How Has This Been Tested?
Visually
Before
After
Markup:
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and backwards compatible changes andnext
for non-backwards compatible changes).