Responsive button layout via ButtonGroup

This commit is contained in:
baldo 2022-08-02 18:16:30 +02:00
parent 33f076b1b6
commit e80b6b2028
6 changed files with 101 additions and 24 deletions
frontend/src/components/form

View file

@ -29,8 +29,6 @@ function onClick() {
@import "../../scss/variables";
button {
margin: 0.3em;
padding: $button-padding;
border-radius: $button-border-radius;
border-width: $button-border-width;

View file

@ -0,0 +1,50 @@
<script setup lang="ts">
import type {ButtonSize} from "@/types";
interface Props {
buttonSize: ButtonSize;
}
const props = defineProps<Props>()
</script>
<template>
<div :class="['button-group', buttonSize]">
<slot></slot>
</div>
</template>
<style lang="scss">
@import "../../scss/variables";
@import "../../scss/mixins";
.button-group {
display: flex;
justify-content: center;
flex-wrap: wrap;
button {
margin: $button-margin;
}
}
@include max-page-breakpoint(smaller) {
.button-group {
flex-direction: column;
button {
margin: $button-margin 0;
width: 100%;
}
}
}
@include page-breakpoint(smaller) {
.button-group {
align-items: center;
button {
flex-grow: 1;
max-width: 80%;
}
}
}
</style>