Hide mouse buttons using visibility: hidden

This commit is contained in:
Joscha 2025-02-11 19:28:39 +01:00
parent 7a58ac37f7
commit 4b6732ccd0
2 changed files with 11 additions and 10 deletions

View file

@ -1,5 +1,6 @@
<script setup lang="ts">
const props = defineProps<{
const { visible, inverted = false } = defineProps<{
visible: boolean;
inverted?: boolean;
}>();
</script>
@ -7,11 +8,11 @@ const props = defineProps<{
<template>
<div
class="flex select-none items-center rounded-sm border p-0.5 transition hover:bg-neutral-200 active:scale-95"
:class="
props.inverted
? 'border-black bg-black text-white hover:bg-neutral-600'
: 'bg-white text-black'
"
:class="{
'bg-white text-black': !inverted,
'border-black bg-black text-white hover:bg-neutral-600': inverted,
hidden: !visible,
}"
>
<slot></slot>
</div>