-
Notifications
You must be signed in to change notification settings - Fork 67
/
_accessibility.scss
126 lines (106 loc) · 2.16 KB
/
_accessibility.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* For image replacement */
.ir {
display: block;
text-indent: -999em;
overflow: hidden;
background-repeat: no-repeat;
text-align: left;
direction: ltr;
br {
display: none;
}
}
/* Hide for both screenreaders and browsers */
.hidden,
/* Hide for both screenreaders and browsers when JS enabled */
.js-enabled .js-hidden {
display: none;
visibility: hidden;
}
/* Hide only visually, but have it available for screenreaders */
.visually-hidden,
.visuallyhidden {
position: absolute;
left: -9999em;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
/*
* Extends the .visuallyhidden class to allow the element to be
* focusable when navigated to via the keyboard
*/
&.focusable:active,
&.focusable:focus {
clip: auto;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
}
}
/* Hide visually and from screenreaders, but maintain layout */
.invisible {
visibility: hidden;
}
/* Give a strong clear visual idea as to what is currently in focus */
a {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0.3);
}
a:focus {
background-color: $focus-colour;
outline: 3px solid $focus-colour;
}
/* Make links slightly darker when focused to improve contrast. */
a:link:focus {
color: darken( $link-colour, 2.5%)
}
/* Make skiplinks visible when they are tabbed to */
.skiplink {
position: absolute;
left: -9999em;
/* Default link colour doesn't have enough contrast against $focus-colour */
&:focus,
&:visited {
color: $text-colour;
}
}
.skiplink:focus {
left: 0;
z-index: 1;
}
#skiplink-container {
text-align: center;
background: $black;
div {
text-align: left;
margin: 0 auto;
max-width: 1020px;
}
.skiplink {
@include inline-block;
margin: 0.75em 0 0 30px;
}
}
input:focus,
textarea:focus,
select:focus,
button:focus {
outline: 3px solid $focus-colour;
outline-offset: 0;
}
#global-header {
input[type=search]:focus {
outline: 3px solid $focus-colour;
/* Focus appears inside the input */
outline-offset: -2px;
}
h1 a:focus {
background-color: transparent;
outline: none;
}
a:focus {
color: $black;
}
}