Skip to content

Commit 3bd4247

Browse files
committed
refactor(plugin-back-to-top): use class name for styles
1 parent b707f9e commit 3bd4247

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/@vuepress/plugin-back-to-top/src/components/BackToTop.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Transition name="back-to-top">
33
<svg
44
v-if="show"
5-
id="back-to-top"
5+
class="back-to-top"
66
xmlns="http://www.w3.org/2000/svg"
77
viewBox="0 0 49.484 28.284"
88
@click="scrollToTop"
@@ -29,6 +29,7 @@
2929

3030
<script lang="ts">
3131
import { computed, defineComponent, onMounted, ref } from 'vue'
32+
// @ts-ignore
3233
import * as debounce from 'lodash.debounce'
3334
3435
const getScrollTop = (): number =>
@@ -71,7 +72,7 @@ export default defineComponent({
7172
--back-to-top-color-hover: #71cda3;
7273
}
7374
74-
#back-to-top {
75+
.back-to-top {
7576
cursor: pointer;
7677
position: fixed;
7778
bottom: 2rem;
@@ -81,7 +82,7 @@ export default defineComponent({
8182
z-index: 1;
8283
}
8384
84-
#back-to-top:hover {
85+
.back-to-top:hover {
8586
color: var(--back-to-top-color-hover);
8687
}
8788

packages/@vuepress/theme-default/src/styles/plugins.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@require './_variables';
22

3-
#back-to-top {
3+
.back-to-top {
44
--back-to-top-color: $accentColor;
55
--back-to-top-color-hover: lighten($accentColor, 30%);
66
}

0 commit comments

Comments
 (0)