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

79 lines
1.2 KiB
Vue

<script>
export default {
name: 'Section',
props: {
title: String,
padding: {
type: Boolean,
default: true,
}
}
};
</script>
<template>
<div class="section" :class="{ 'section-extra-padding': padding }">
<h2 class="section-header">
<slot name="header-title">{{ title }}</slot>
<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;
}
.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;
}
.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;
}
</style>