CommonTab.vue 786 B

123456789101112131415161718192021222324252627282930
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. interface Props {
  5. active?: boolean
  6. noActiveBackground?: boolean
  7. }
  8. const props = defineProps<Props>()
  9. const colorClasses = computed(() => {
  10. if (props.active)
  11. return props.noActiveBackground
  12. ? 'text-black dark:text-white'
  13. : 'bg-white text-black dark:bg-gray-200 dark:text-white'
  14. return ''
  15. })
  16. </script>
  17. <template>
  18. <span
  19. class="-:text-gray-100 -:dark:text-neutral-400 -:transition-colors inline-block text-nowrap rounded-full px-3.5 py-1 text-base outline-none focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-blue-800"
  20. :class="[colorClasses]"
  21. >
  22. <slot />
  23. </span>
  24. </template>