2021-10-14 06:55:59 -05:00
|
|
|
<template>
|
2023-01-02 19:46:56 -06:00
|
|
|
<div :class="[$style.root, { [$style.rootMin]: forceSpacerMin }]">
|
|
|
|
<div :class="$style.content">
|
2021-10-14 06:55:59 -05:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-06-22 02:29:31 -05:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { inject, onMounted, onUnmounted, ref } from 'vue';
|
2022-02-11 07:16:20 -06:00
|
|
|
import { deviceKind } from '@/scripts/device-kind';
|
2021-10-14 06:55:59 -05:00
|
|
|
|
2022-06-22 02:29:31 -05:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
contentMax?: number | null;
|
|
|
|
marginMin?: number;
|
|
|
|
marginMax?: number;
|
|
|
|
}>(), {
|
|
|
|
contentMax: null,
|
|
|
|
marginMin: 12,
|
|
|
|
marginMax: 24,
|
|
|
|
});
|
2021-10-14 06:55:59 -05:00
|
|
|
|
2023-01-02 19:46:56 -06:00
|
|
|
const forceSpacerMin = inject('forceSpacerMin', false) || deviceKind === 'smartphone';
|
2021-10-14 06:55:59 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
|
|
|
box-sizing: border-box;
|
|
|
|
width: 100%;
|
|
|
|
}
|
2023-01-02 19:46:56 -06:00
|
|
|
.rootMin {
|
|
|
|
padding: v-bind('props.marginMin + "px"') !important;
|
|
|
|
}
|
2021-10-14 06:55:59 -05:00
|
|
|
|
|
|
|
.content {
|
|
|
|
margin: 0 auto;
|
2023-01-02 19:46:56 -06:00
|
|
|
max-width: v-bind('props.contentMax + "px"');
|
2022-12-25 17:40:13 -06:00
|
|
|
container-type: inline-size;
|
2021-10-14 06:55:59 -05:00
|
|
|
}
|
2023-01-02 19:46:56 -06:00
|
|
|
|
2023-01-06 20:49:04 -06:00
|
|
|
@container (max-width: 450px) {
|
2023-01-02 19:46:56 -06:00
|
|
|
.root {
|
|
|
|
padding: v-bind('props.marginMin + "px"');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-06 20:49:04 -06:00
|
|
|
@container (min-width: 451px) {
|
2023-01-02 19:46:56 -06:00
|
|
|
.root {
|
|
|
|
padding: v-bind('props.marginMax + "px"');
|
|
|
|
}
|
|
|
|
}
|
2021-10-14 06:55:59 -05:00
|
|
|
</style>
|