slidev-theme-narduin/layouts/auto-grid.vue

29 lines
487 B
Vue
Raw Normal View History

2024-12-16 23:40:18 +01:00
<script setup lang="ts">
const props = defineProps<{
columns?: number
}>()
</script>
2024-12-16 21:25:03 +01:00
<template>
<div class="slidev-layout">
<slot />
<div class="auto-grid">
<slot name="content" />
</div>
</div>
</template>
<style scoped>
.auto-grid {
2024-12-16 23:40:18 +01:00
--_columns: v-bind(columns);
2024-12-16 21:25:03 +01:00
display: grid;
2024-12-16 23:40:18 +01:00
grid-template-columns: repeat(var(--_columns, 2), 1fr);
grid-auto-rows: 250px;
2024-12-16 21:25:03 +01:00
gap: var(--space-xs);
}
2024-12-16 23:40:18 +01:00
.auto-grid > * {
inline-size: 100%;
block-size: 100%;
}
2024-12-16 21:25:03 +01:00
</style>