Skip to content

Commit

Permalink
feat(VListItemSubtitle): add new opacity prop
Browse files Browse the repository at this point in the history
resolves #16446
  • Loading branch information
johnleider committed Apr 16, 2024
1 parent 2abb221 commit 565a794
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
6 changes: 0 additions & 6 deletions packages/vuetify/src/components/VList/VListItemSubtitle.ts

This file was deleted.

39 changes: 39 additions & 0 deletions packages/vuetify/src/components/VList/VListItemSubtitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Composables
import { makeComponentProps } from '@/composables/component'
import { makeTagProps } from '@/composables/tag'

// Utilities
import { genericComponent, propsFactory, useRender } from '@/util'

export const makeVListItemSubtitleProps = propsFactory({
opacity: [Number, String],

...makeComponentProps(),
...makeTagProps(),
}, 'VListItemSubtitle')

export const VListItemSubtitle = genericComponent()({
name: 'VListItemSubtitle',

props: makeVListItemSubtitleProps(),

setup (props, { slots }) {
useRender(() => (
<props.tag
class={[
'v-list-item-subtitle',
props.class,
]}
style={[
{ '--v-list-item-subtitle-opacity': props.opacity },
props.style,
]}
v-slots={ slots }
/>
))

return {}
},
})

export type VListItemSubtitle = InstanceType<typeof VListItemSubtitle>
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VList/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ $list-item-nav-subtitle-font-weight: tools.map-deep-get(settings.$typography, 'b
$list-item-nav-subtitle-letter-spacing: tools.map-deep-get(settings.$typography, 'body-2', 'letter-spacing') !default;
$list-item-nav-subtitle-line-height: 1rem !default;

$list-item-subtitle-opacity: var(--v-medium-emphasis-opacity) !default;
$list-item-subtitle-opacity: var(--v-list-item-subtitle-opacity, var(--v-medium-emphasis-opacity)) !default;
$list-item-subtitle-font-size: tools.map-deep-get(settings.$typography, 'body-2', 'size') !default;
$list-item-subtitle-font-weight: tools.map-deep-get(settings.$typography, 'body-2', 'weight') !default;
$list-item-subtitle-letter-spacing: tools.map-deep-get(settings.$typography, 'body-2', 'letter-spacing') !default;
Expand Down

0 comments on commit 565a794

Please sign in to comment.