LayoutMain.vue 821 B

1234567891011121314151617181920212223242526272829303132333435
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. import type { BackgroundVariant } from './types.ts'
  5. export interface Props {
  6. backgroundVariant?: BackgroundVariant
  7. noPadding?: boolean
  8. }
  9. const props = withDefaults(defineProps<Props>(), {
  10. backgroundVariant: 'tertiary',
  11. })
  12. const backgroundVariantClasses = computed(() => {
  13. switch (props.backgroundVariant) {
  14. case 'primary':
  15. return 'bg-blue-50 dark:bg-gray-800'
  16. case 'tertiary':
  17. default:
  18. return 'bg-neutral-50 dark:bg-gray-500'
  19. }
  20. })
  21. </script>
  22. <template>
  23. <main
  24. class="-:overflow-y-auto h-full w-full text-gray-100 dark:text-neutral-400"
  25. :class="[backgroundVariantClasses, { 'p-4': !noPadding }]"
  26. >
  27. <slot />
  28. </main>
  29. </template>