-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaccessibility.css
More file actions
89 lines (80 loc) · 1.71 KB
/
Copy pathaccessibility.css
File metadata and controls
89 lines (80 loc) · 1.71 KB
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
/* Skip to main content link */
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: #000;
color: #fff;
padding: 8px 16px;
text-decoration: none;
z-index: 100;
font-weight: 600;
border-radius: 0 0 4px 0;
}
.skip-link:focus {
top: 0;
outline: 3px solid #fff;
outline-offset: 2px;
}
/* Focus indicators for all interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
outline: 3px solid var(--link-color);
outline-offset: 2px;
outline-style: solid;
}
/* Remove default outline for mouse users, keep for keyboard users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
outline: none;
}
/* Enhanced focus for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
outline: 3px solid var(--link-color);
outline-offset: 2px;
box-shadow: 0 0 0 4px color-mix(in srgb, var(--link-color) 20%, transparent);
}
/* Ensure sufficient color contrast for text */
body {
color: var(--text-primary);
background-color: var(--bg-primary);
}
/* Improve visibility of interactive elements */
button,
a {
transition: outline 0.2s ease;
}
/* Screen reader only class */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
padding: inherit;
margin: inherit;
overflow: visible;
clip: auto;
white-space: normal;
}