Fullwidth property for seasoned button

This commit is contained in:
2022-01-10 00:50:47 +01:00
parent 2937e7b974
commit aa7e6a2a53

View File

@@ -1,26 +1,34 @@
<template> <template>
<button type="button" @click="emit('click')" :class="{ active: active }"> <button
type="button"
@click="emit('click')"
:class="{ active: active, fullwidth: fullWidth }"
>
<slot></slot> <slot></slot>
</button> </button>
</template> </template>
<script> <script>
export default { export default {
name: 'seasonedButton', name: "seasonedButton",
props: { props: {
active: { active: {
type: Boolean, type: Boolean,
default: false, default: false,
required: false required: false
},
fullWidth: {
type: Boolean,
default: false,
required: false
} }
}, },
methods: { methods: {
emit() { emit() {
this.$emit('click') this.$emit("click");
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -43,14 +51,25 @@ button {
background: $background-color-secondary; background: $background-color-secondary;
cursor: pointer; cursor: pointer;
outline: none; outline: none;
transition: background 0.5s ease, color 0.5s ease, border-color .5s ease; transition: background 0.5s ease, color 0.5s ease, border-color 0.5s ease;
@include desktop { @include desktop {
font-size: 0.8rem; font-size: 0.8rem;
padding: 6px 20px 5px 20px; padding: 6px 20px 5px 20px;
} }
&:focus, &:active, &.active { &.fullwidth {
font-size: 14px;
width: 40%;
@include mobile {
width: 60%;
}
}
&:focus,
&:active,
&.active {
background: $text-color; background: $text-color;
color: $background-color; color: $background-color;
} }