Skip to content

Commit 1bc1957

Browse files
add return-to-top anchor
1 parent 3bcf148 commit 1bc1957

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

src/page_faqs.php

+2
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@
226226

227227
</div>
228228

229+
<a href="#main-content-marker" class="return-to-top"><span class="icon-attach fa-angle-up">Return to top</span></a>
230+
229231
<?php endwhile; // end of the loop. ?>
230232

231233
</main>

src/single-faqs-group.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119

120120
</div>
121121

122-
122+
<a href="#main-content-marker" class="return-to-top"><span class="icon-attach fa-angle-up">Return to top</span></a>
123123

124124
<?php endwhile; // end of the loop. ?>
125125
</main>

src/style.css

+45
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ main nav.pagination ul li span.current {
559559
grid-column: 1 / span 7;
560560
padding: 3em 4em;
561561
margin-bottom: 4em;
562+
z-index: 1000;
562563

563564
background: var(--vocabulary-neutral-color-lighter-gray);
564565
}
@@ -643,10 +644,54 @@ main nav.pagination ul li span.current {
643644
margin-top: 0;
644645
}
645646

647+
.faq-index footer, .faq-page footer {
648+
z-index: 1000;
649+
}
650+
646651
.faq-page .breadcrumbs {
647652
font-family: 'Source Sans Pro';
648653
}
649654

655+
.return-to-top {
656+
display: inline-block;
657+
position: absolute;
658+
top: 90%;
659+
right: 5%;
660+
height: 300%;
661+
width: 100px;
662+
663+
font-family: 'Source Sans Pro';
664+
}
665+
666+
.return-to-top span {
667+
position: fixed;
668+
padding-bottom: 5px;
669+
border-bottom: 2px solid var(--vocabulary-brand-color-dark-tomato);
670+
}
671+
672+
.return-to-top span:before {
673+
content: '';
674+
position: absolute;
675+
left: 32%;
676+
top: -1em;
677+
678+
font-size: 2em;
679+
}
680+
681+
.return-to-top:after {
682+
position: absolute;
683+
bottom: 5%;
684+
left: 0;
685+
display: block;
686+
content: '';
687+
height: 100%;
688+
width: 100%;
689+
z-index: 500;
690+
691+
background: white;
692+
}
693+
694+
650695

651696
@media (min-width: 1500px) {
652697

0 commit comments

Comments
 (0)