feat: make totop optional and normal
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user