summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/form/section.vue
blob: b23ed51a8322a87b247d499f50015fcae4a7d313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<div :class="[$style.root, { [$style.rootFirst]: first }]">
	<div :class="[$style.label, { [$style.labelFirst]: first }]"><slot name="label"></slot></div>
	<div :class="[$style.description]"><slot name="description"></slot></div>
	<div :class="$style.main">
		<slot></slot>
	</div>
</div>
</template>

<script lang="ts" setup>
defineProps<{
	first?: boolean;
}>();
</script>

<style lang="scss" module>
.root {
	border-top: solid 0.5px var(--MI_THEME-divider);
	//border-bottom: solid 0.5px var(--MI_THEME-divider);
}

.rootFirst {
	border-top: none;
}

.label {
	font-weight: bold;
	padding: 1.5em 0 0 0;
	margin: 0 0 8px 0;

	&:empty {
		display: none;
	}
}

.labelFirst {
	padding-top: 0;
}

.main {
	margin: 1.5em 0 0 0;
}

.description {
	font-size: 0.85em;
	color: color(from var(--MI_THEME-fg) srgb r g b / 0.75);
	margin: 0 0 8px 0;
}
</style>