DigitalConsumer.FixMyGlass/src/ux-components/button-back/button-back.vue

96 lines
1.8 KiB
Vue

<template>
<a
v-if="backButtonUrl || backButtonAction"
:href="backButtonUrl || '#'"
@click="handleClick($event)"
class="back-button-wrapper d-flex p-0"
:aria-label="backButtonAccessibleText"
>
<div class="button-back">
<div class="arrow-left"></div>
<div class="box"></div>
</div>
</a>
</template>
<script>
export default {
name: "buttonBack",
props: {
backButtonUrl: {
type: String,
default: "",
},
backButtonAccessibleText: {
type: String,
required: true,
},
backButtonAction: {
type: Function,
default: null,
}
},
methods: {
handleClick: function (event) {
if (this.backButtonAction) {
event.preventDefault();
this.backButtonAction();
}
},
},
};
</script>
<style lang="scss">
.back-button-wrapper {
border: none;
background: transparent;
text-decoration: none;
border-bottom: none;
.button-back {
display: inline-flex;
position: relative;
height: 18px;
width: 23px;
overflow: hidden;
.arrow-left {
position: absolute;
width: 18px;
height: 18px;
left: 4px;
background-color: $gray-550;
transform: rotate(45deg);
border-radius: 4px;
}
.box {
content: "";
position: absolute;
background: $gray-550;
height: 100%;
width: 11px;
display: flex;
justify-content: center;
align-items: center;
left: 12px;
border-radius: 5px;
&:before, &:after {
position: absolute;
left: 1px;
top: 3px;
content: " ";
height: 12px;
width: 2px;
background-color: $white;
border-radius: 2px;
}
&:before {
transform: rotate(45deg);
}
&:after {
transform: rotate(-45deg);
}
}
}
}
</style>