From f7c62f59621c75002d10afc0dfcf80cb32cd9485 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Tue, 11 Jun 2024 04:22:50 +0800 Subject: [PATCH] Overhaul back to top button and link Make back-to-top button an anchor element and shows back to top text link if JavaScript is disabled --- src/_includes/global/footer.njk | 19 ----------- src/_includes/global/top-btn.njk | 56 ++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/src/_includes/global/footer.njk b/src/_includes/global/footer.njk index e72355cb..00e912a8 100644 --- a/src/_includes/global/footer.njk +++ b/src/_includes/global/footer.njk @@ -13,7 +13,6 @@ {%- endif -%} -
{%- include "global/top-btn.njk" %} @@ -55,24 +54,6 @@ justify-self: center; } - .footer__top-link::before, - .footer__top-link::after { - --arrow-margin: 0.3em; - content: ""; - display: inline-block; - border-bottom: 0.6rem solid currentColor; - border-left: 0.4rem solid transparent; - border-right: 0.4rem solid transparent; - } - - .footer__top-link::before { - margin: 0 var(--arrow-margin) 0 0; - } - - .footer__top-link::after { - margin: 0 0 0 var(--arrow-margin); - } - /* Screen sizes larger than mobile */ @media only screen and (min-width: 30rem) { .footer { diff --git a/src/_includes/global/top-btn.njk b/src/_includes/global/top-btn.njk index fb734623..4bcbd3bb 100644 --- a/src/_includes/global/top-btn.njk +++ b/src/_includes/global/top-btn.njk @@ -1,22 +1,28 @@ - + Back to Top + + \ No newline at end of file