Skip to content
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

feat(VList): add prependSpacer prop #20616

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft

Conversation

yuwu9145
Copy link
Member

@yuwu9145 yuwu9145 commented Oct 25, 2024

Description

Markup:

<template>
  <v-card
    class="mx-auto"
    max-width="300"
  >
    <v-list :slim-width="100" slim>
      <v-list-subheader>Plain Variant</v-list-subheader>

      <v-list-item
        v-for="(item, i) in items"
        :key="i"
        :value="item"
        color="primary"
        variant="plain"
      >
        <template #prepend>
          <v-icon :icon="item.icon" />
        </template>

        <v-list-item-title v-text="item.text" />
      </v-list-item>

      <v-list-group>
        <template #activator="{ props: activatorProps }">
          <v-list-item prepend-icon="$vuetify" title="Parent" v-bind="activatorProps" />
        </template>

        <v-list-item
          v-for="(item, i) in items"
          :key="i"
          :value="item"
          color="primary"
          variant="plain"
        >
          <template #prepend>
            <v-icon :icon="item.icon" />
          </template>

          <v-list-item-title v-text="item.text" />
        </v-list-item>

        <v-list-group>
          <template #activator="{ props: activatorProps }">
            <v-list-item prepend-icon="$vuetify" title="Parent" v-bind="activatorProps" />
          </template>

          <v-list-item
            v-for="(item, i) in items"
            :key="i"
            :value="item"
            color="primary"
            variant="plain"
          >
            <template #prepend>
              <v-icon :icon="item.icon" />
            </template>

            <v-list-item-title v-text="item.text" />
          </v-list-item>
        </v-list-group>
      </v-list-group>
    </v-list>

    <v-list>
      <v-list-subheader>Tonal Variant</v-list-subheader>

      <v-list-item
        v-for="(item, i) in items"
        :key="i"
        :value="item"
        color="primary"
        variant="tonal"
      >
        <template #prepend>
          <v-icon :icon="item.icon" />
        </template>

        <v-list-item-title v-text="item.text" />
      </v-list-item>
    </v-list>
  </v-card>
</template>

<script>
  export default {
    data: () => ({
      items: [
        { text: 'Real-Time', icon: 'mdi-clock' },
        { text: 'Audience', icon: 'mdi-account' },
        { text: 'Conversions', icon: 'mdi-flag' },
      ],
    }),
  }
</script>

@yuwu9145 yuwu9145 marked this pull request as ready for review October 25, 2024 11:37
@yuwu9145
Copy link
Member Author

Does it make it too complex to reduce the spacing between parent/child as well?

Setting sass variable$list-indent-size to 0 makes it look much better. But I need to do some more work to figure out any potential breaking changes if we do that

@MajesticPotatoe MajesticPotatoe added T: feature A new feature C: VList VList labels Oct 28, 2024
@yuwu9145 yuwu9145 marked this pull request as draft November 2, 2024 12:31
@yuwu9145
Copy link
Member Author

yuwu9145 commented Nov 5, 2024

FYI: I'm still trying to fix the indent issue.

It's a complicated one but I found the problem, it's the --prepend css modifier applied incorrectly in nested scenario. Trying to find a solution atm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VList VList T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants