Skip to content

Commit

Permalink
fix(VList): add new prop active-color and contained
Browse files Browse the repository at this point in the history
fixes #9285
  • Loading branch information
johnleider committed Jun 10, 2021
1 parent d19c06c commit 34a2683
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/vuetify/src/components/VList/VListItem.sass
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,6 @@
right: 0
top: 0
transition: opacity 0.2s ease-in-out

.v-list-item--active.v-list-item--contained &
--v-theme-overlay-multiplier: 0
6 changes: 3 additions & 3 deletions packages/vuetify/src/components/VList/VListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default defineComponent({
prependAvatar: String,
prependIcon: String,
subtitle: String,
text: String,
contained: String,
title: String,
...makeBorderProps(),
...makeDensityProps(),
Expand All @@ -58,7 +58,7 @@ export default defineComponent({
setup (props, { attrs, slots }) {
const { themeClasses } = useTheme(props)
const { colorClasses, colorStyles } = useColor(computed(() => {
const key = props.text || !props.active ? 'text' : 'background'
const key = props.contained && props.active ? 'background' : 'text'
const color = (props.active && props.activeColor) || props.color

return { [`${key}`]: color }
Expand Down Expand Up @@ -86,7 +86,7 @@ export default defineComponent({
'v-list-item--active': props.active,
'v-list-item--disabled': props.disabled,
'v-list-item--link': isLink,
'v-list-item--text': props.text,
'v-list-item--contained': props.contained,
[`${props.activeClass}`]: props.active && props.activeClass,
},
themeClasses.value,
Expand Down

0 comments on commit 34a2683

Please sign in to comment.