Skip to content

Commit 73bfbf4

Browse files
committed
Add the Gutter component
1 parent 0986509 commit 73bfbf4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

components/Gutter.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<script lang="ts" setup>
2+
defineProps<{ show: boolean, size: number }>()
3+
</script>
4+
5+
<template>
6+
<Transition name="gutter">
7+
<div v-show="show" class="gutter flex flex-shrink-0 overflow-hidden">
8+
<div class="gutter-content flex flex-grow flex-shrink flex-col w-full lg:w-auto">
9+
<slot />
10+
</div>
11+
</div>
12+
</Transition>
13+
</template>
14+
15+
<style scoped>
16+
.gutter {
17+
width: calc(v-bind('size') * 1px);
18+
}
19+
20+
.gutter-content {
21+
width: calc(v-bind('size') * 1px);
22+
flex-shrink: 0;
23+
}
24+
25+
.gutter-enter-active,
26+
.gutter-leave-active {
27+
transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
28+
}
29+
30+
.gutter-enter-from,
31+
.gutter-leave-to {
32+
width: 0;
33+
}
34+
</style>

0 commit comments

Comments
 (0)