Skip to content
This repository was archived by the owner on Jul 5, 2022. It is now read-only.

Commit 6c8dc3d

Browse files
committed
add a11y to back to top button
1 parent 52a2252 commit 6c8dc3d

File tree

2 files changed

+44
-41
lines changed

2 files changed

+44
-41
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{% comment %}
2-
A back to top button
3-
{% endcomment %}
4-
5-
<div class="back-to-top-button" title="back to top">
6-
<span>&nbsp;</span>
7-
<span>&nbsp;</span>
8-
</div>
1+
{% comment %}
2+
A back to top button
3+
{% endcomment %}
4+
5+
<div class="back-to-top-button" title="back to top" aria-label="back to top" tabindex="0">
6+
<span>&nbsp;</span>
7+
<span>&nbsp;</span>
8+
</div>
Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
2-
.back-to-top-button
3-
background: $ct-blue
4-
z-index: 99
5-
position: fixed
6-
bottom: -50px
7-
right: 5px
8-
padding: 20px 5px 10px 5px
9-
border-radius: 5px
10-
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.6)
11-
cursor: pointer
12-
transition: all ease-in-out 0.5s
13-
14-
> span
15-
background: #eee
16-
width: 30px
17-
height: 7px
18-
border-radius: 5px
19-
margin-bottom: 10px
20-
position: relative
21-
22-
> span:nth-child(1)
23-
transform: rotate(-45deg)
24-
float: left
25-
left: 7px
26-
27-
> span:nth-child(2)
28-
transform: rotate(45deg)
29-
float: right
30-
right: 7px
31-
32-
.back-to-top-button.active
33-
bottom: 5px
1+
2+
.back-to-top-button
3+
background: $ct-blue
4+
z-index: 99
5+
position: fixed
6+
bottom: -50px
7+
right: 5px
8+
padding: 20px 5px 10px 5px
9+
border-radius: 5px
10+
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.6)
11+
cursor: pointer
12+
transition: all ease-in-out 0.5s
13+
14+
> span
15+
background: #eee
16+
width: 30px
17+
height: 7px
18+
border-radius: 5px
19+
margin-bottom: 10px
20+
position: relative
21+
22+
> span:nth-child(1)
23+
transform: rotate(-45deg)
24+
float: left
25+
left: 7px
26+
27+
> span:nth-child(2)
28+
transform: rotate(45deg)
29+
float: right
30+
right: 7px
31+
32+
.back-to-top-button.active
33+
bottom: 5px
34+
35+
.back-to-top-button:hover, .back-to-top-button:focus
36+
outline: rgb(31, 31, 31) auto 1px

0 commit comments

Comments
 (0)