forked from solutions-plug/predictIQ
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccessibility.css
More file actions
223 lines (207 loc) · 5.19 KB
/
Copy pathaccessibility.css
File metadata and controls
223 lines (207 loc) · 5.19 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/**
* Accessibility utilities — WCAG 2.1 AA.
* Visual/brand styling lives in tokens.css + landing.css; this file keeps only
* accessibility-critical rules (skip links, SR-only, focus, motion, contrast).
*/
/* ============================================
SKIP LINKS
============================================ */
.skip-link {
position: absolute;
top: -60px;
left: 1rem;
z-index: 1000;
background: var(--fg, #000);
color: var(--bg, #fff);
padding: 10px 18px;
border-radius: var(--radius-sm, 8px);
text-decoration: none;
font-weight: 600;
transition: top var(--dur-fast, 160ms) var(--ease-expo, ease);
}
.skip-link:focus {
top: 1rem;
outline: 3px solid var(--ring-strong, var(--ring, #f59e0b));
outline-offset: 2px;
}
/* ============================================
VISUALLY HIDDEN (Screen Reader Only)
============================================ */
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
.visually-hidden:focus {
position: static;
width: auto;
height: auto;
padding: inherit;
margin: inherit;
overflow: visible;
clip: auto;
white-space: normal;
}
/* ============================================
FOCUS INDICATORS
--ring-strong is a mode-aware token (see tokens.css) that keeps >= 3:1
non-text contrast against EVERY background token in both light and dark
schemes (WCAG 2.1 AA non-text contrast / visibility of focus).
============================================ */
*:focus-visible {
outline: 3px solid var(--ring-strong, var(--ring, #f59e0b));
outline-offset: 2px;
border-radius: 4px;
}
*:focus:not(:focus-visible) {
outline: none;
}
/* ============================================
ERROR BOUNDARY FALLBACK
============================================ */
.error-boundary-fallback {
max-width: 640px;
margin: 3rem auto;
padding: 2rem;
border: 1px solid var(--destructive, #f87171);
border-radius: var(--radius, 14px);
background: var(--surface, #111a2e);
color: var(--fg, #f8fafc);
}
.error-boundary-fallback h2 {
color: var(--destructive, #f87171);
margin-top: 0;
}
.error-boundary-fallback .error-details {
font-family: ui-monospace, monospace;
font-size: 0.875rem;
background: var(--surface-2, #16223b);
color: var(--fg-muted, #9fb0cc);
padding: 1rem;
border-radius: var(--radius-sm, 8px);
overflow-x: auto;
}
/* ============================================
ERROR / REQUIRED STATES
============================================ */
.error-message {
color: var(--destructive, #f87171);
font-size: 0.875rem;
margin-top: 0.25rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.error-message::before {
content: '⚠';
font-weight: bold;
}
input[aria-invalid='true'],
textarea[aria-invalid='true'] {
border-color: var(--destructive, #f87171) !important;
}
.required {
color: var(--destructive, #f87171);
font-weight: bold;
margin-left: 0.25rem;
}
/* ============================================
INTERACTIVE TARGET SIZE — WCAG 2.5.5 (44 x 44 CSS px)
Every button, link, and form control gets a hit target of at least
44 x 44px so low-motion / touch users can reliably activate it.
============================================ */
button,
[role='button'],
a[href],
input,
select,
textarea,
summary {
min-height: 44px;
min-width: 44px;
}
/* ============================================
TEXT SIZING (scales to 200% cleanly)
============================================ */
html {
font-size: 16px;
}
@media (max-width: 768px) {
html {
font-size: 15px;
}
}
@media (min-width: 1400px) {
html {
font-size: 17px;
}
}
/* ============================================
HIGH CONTRAST
============================================ */
@media (prefers-contrast: high) {
* {
border-color: currentColor !important;
}
*:focus-visible {
outline-width: 4px;
}
}
/* ============================================
REDUCED MOTION
Disables non-essential animation for users who opt out of motion, covering
the loading spinner (spin), skeleton shimmer, toast in/out transitions, and
any other keyframe/transition. Essential functionality is unaffected.
============================================ */
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
*,
*::before,
*::after {
animation-name: none !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
.spinner,
.loading-spinner .spinner,
.skeleton {
animation: none !important;
}
}
/* ============================================
STATE UTILITIES
============================================ */
[aria-busy='true'] {
cursor: wait;
}
[aria-disabled='true'],
[disabled] {
cursor: not-allowed;
}
/* ============================================
PRINT
============================================ */
@media print {
.skip-link,
header[role='banner'],
button {
display: none;
}
body {
background: #fff;
color: #000;
}
a[href]::after {
content: ' (' attr(href) ')';
}
}