add dark mode in basedropdown

This commit is contained in:
yashkanakiya
2023-03-22 16:16:42 +05:30
parent 15f3f566e3
commit 1f5bb49333
18 changed files with 116 additions and 89 deletions

View File

@ -2,16 +2,19 @@
<MenuItem v-slot="{ active }" v-bind="$attrs">
<a
href="#"
:class="[
active ? 'bg-gray-100 text-gray-900' : 'text-gray-700',
'group flex items-center px-4 py-2 text-sm font-normal',
class="group flex items-center px-4 py-2 text-sm font-normal" :class="[
active
? 'bg-gray-100 text-gray-900 dark:text-white dark:bg-gray-700'
: 'text-gray-700 dark:text-gray-200',
]"
>
<slot :active="active" />
<slot :active="active" :class="defaultIconClass" />
</a>
</MenuItem>
</template>
<script setup>
import { MenuItem } from '@headlessui/vue'
const defaultIconClass
= 'w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-white'
</script>