feat: make totop optional and normal

This commit is contained in:
2022-08-10 11:40:02 -04:00
parent de40d01939
commit b739e46fe7
5 changed files with 23 additions and 11 deletions

View File

@@ -1,23 +1,16 @@
<template>
<Teleport to="body"> <a href="#" class="go-top" /></Teleport>
<a href="#" class="go-top" />
</template>
<style>
body {
display: grid;
grid-template-columns: 0 auto;
}
</style>
<style scoped>
.go-top {
--offset: 20rem;
position: sticky;
bottom: 1rem;
left: 1rem;
margin-right: 1rem;
place-self: end;
margin-top: calc(100vh + var(--offset));
width: 2rem;
height: 2rem;
background: #ff8b24;