Files
cloudron-box/dashboard/src/components/Section.vue
T

95 lines
1.6 KiB
Vue

<script setup>
defineProps({
title: String,
padding: {
type: Boolean,
default: true,
},
titleBadge: {
type: String,
default: '',
},
});
</script>
<template>
<div class="section" :class="{ 'section-extra-padding': padding }">
<h2 class="section-header">
<div>
<slot name="header-title">{{ title }}</slot>
<div class="section-header-title-badge" v-if="titleBadge">{{ titleBadge }}</div>
</div>
<div><slot name="header-buttons"></slot></div>
</h2>
<hr class="section-divider"/>
<div class="section-body">
<slot></slot>
</div>
</div>
</template>
<style>
.section {
margin-bottom: 30px;
position: relative;
}
.section-header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
gap: 5px;
padding-left: 15px;
padding-right: 15px;
padding-top: 25px;
margin-top: 0;
}
.section-header > div {
display: flex;
gap: 6px;
flex-wrap: wrap;
align-items: center;
}
.section-divider {
border-color: #d8dee4;
border-width: 1px;
margin-top: 10px;
margin-bottom: 10px;
}
@media (prefers-color-scheme: dark) {
.section-divider {
border-color: #495057;
}
}
.section-body {
position: relative;
margin-bottom: 15px;
padding: 10px 15px;
padding-bottom: 25px;
}
.section-extra-padding .section-body {
padding-left: 25px;
padding-right: 25px;
}
.section-header-title-badge {
display: inline-block;
font-size: 12px;
font-weight: 700;
color: white;
border-radius: 20px;
background-color: #00c383;
padding: 2px 10px;
margin-left: 10px;
}
</style>