Basic styling

This commit is contained in:
2023-06-15 13:08:02 +02:00
parent 3ec139c8bd
commit a82f7f3b73
4 changed files with 14 additions and 15 deletions

View File

@@ -1,13 +1,9 @@
<script setup lang="ts">
import { ref } from 'vue'
const hiddenOrActive = ref('hidden');
const isActive = ref(false);
function switchHiddenElement(){
if(hiddenOrActive.value == 'hidden'){
hiddenOrActive.value = "active";
} else{
hiddenOrActive.value = "hidden"
}
isActive.value = !isActive.value;
}
const props = defineProps(
@@ -22,10 +18,10 @@ const props = defineProps(
<template>
<li>
<button @click="switchHiddenElement()" type="button" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">
<span class="flex-1 ml-3 text-left whitespace-nowrap">{{props.categoryName}}</span>
<button @click="switchHiddenElement()" type="button" :class="[isActive ? 'rounded-t-lg bg-white dark:bg-gray-700' : 'rounded-lg']" class="flex items-center w-full p-2 text-lg font-bold text-gray-900 transition duration-75 group hover:bg-blue-100 dark:text-white dark:hover:bg-gray-700">
<span class="flex-1 text-center items-center whitespace-nowrap">{{props.categoryName}}</span>
</button>
<ul class='py-2 space-y-2 bg-gray-50 dark:bg-gray-700 rounded-xl' :class="hiddenOrActive">
<ul class="py-2 space-y-2 bg-white dark:bg-gray-700 rounded-b-xl" :class="[isActive ? 'active' : 'hidden']">
<slot></slot>
</ul>
</li>