-
Notifications
You must be signed in to change notification settings - Fork 744
/
color-contrast.html
467 lines (429 loc) · 10.7 KB
/
color-contrast.html
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<div id="pass1" style="background-color: white; color: black">
This is a pass.
</div>
<div id="pass2" style="background-color: gray; color: white; font-size: 40px">
This is a pass.
</div>
<div
id="pass3"
style="
background-color: gray;
color: white;
font-size: 20px;
font-weight: bold;
"
>
This is a pass.
</div>
<div style="background-color: black">
<div
style="color: transparent; text-shadow: 0 0 0 white"
id="text-shadow-fg-pass"
>
Pass.
</div>
</div>
<div id="fail1" style="background-color: gray; color: white; font-size: 20px">
This is a fail.<b id="pass4">But this is a pass.</b>
</div>
<div style="background-color: black">
<div
style="background-color: rgba(255, 255, 255, 0.1); color: white"
id="pass5"
>
Pass.
</div>
</div>
<div style="position: relative; height: 40px">
<label style="background-color: black; color: white" id="pass7">
Label
<input style="position: absolute; top: 20px" />
</label>
</div>
<div
id="pass8"
style="color: #000; background: #737373; text-shadow: white 0 0 3px"
>
Hello world
</div>
<div id="fail2" style="background-color: gray; color: white; font-size: 8px">
This is a fail.
</div>
<div id="fail3" style="background-color: yellow; color: white; font-size: 40px">
This is a fail.
</div>
<div style="background-color: white">
<div id="fail6" style="opacity: 0.1; background-color: white; color: black">
This is a fail.
</div>
</div>
<div
id="fail7"
style="color: #000; background: #777; text-shadow: black 0 0 0.2em"
>
Hello world
</div>
<!-- shouldnt run -->
<input
id="ignore0"
style="background: #000; color: #000"
value="hello"
type="hidden"
/>
<input
id="ignore1"
style="background: #000; color: #000"
value="hello"
type="radio"
/>
<input
id="ignore2"
style="background: #000; color: #000"
value="hello"
type="checkbox"
/>
<input
id="ignore4"
style="background: #000; color: #000"
value="hello"
type="hidden"
/>
<select id="ignore5" style="background: #000; color: #000"></select>
<div
id="ignore6"
style="
color: yellow;
width: 100px;
overflow: hidden;
text-indent: 200px;
background-color: white;
"
>
text
</div>
<label for="disabled1">Hello</label>
<input id="disabled1" disabled />
<div id="disabled2">Hello</div>
<input aria-labelledby="disabled2" disabled />
<div
id="disabled3"
style="background: #000; color: #000"
role="alert"
aria-disabled="true"
>
hello
</div>
<label style="color: #fff" id="disabled4">
Test
<input type="text" disabled />
</label>
<div
style="
background-image: url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7);
"
>
<div style="color: white" id="canttell1">Background image</div>
</div>
<div style="height: 40px; position: relative">
<div
style="
background-color: white;
height: 60px;
width: 40px;
border: 1px solid;
"
>
<div
id="canttell2"
style="color: white; height: 40px; width: 60px; border: 1px solid red"
>
Outside parent
</div>
</div>
</div>
<div style="background-color: white; height: 60px; width: 40px">
<div id="canttell3" style="color: white; height: 40px; width: 60px">
Background overlap
</div>
</div>
<div
style="
background-color: white;
height: 60px;
width: 80px;
border: 1px solid;
position: relative;
"
>
<div
id="canttell4"
style="color: white; height: 40px; width: 60px; border: 1px solid red"
>
Element overlap
</div>
<div
style="
position: absolute;
top: 0;
width: 60px;
height: 40px;
background-color: #000;
"
></div>
</div>
<div style="background-color: white">
<div
style="background-color: rgba(255, 255, 255, 0.1); color: white"
id="canttell5"
>
1:1 ratio with transparency
</div>
</div>
<input
id="canttell6"
style="background: #000; color: #000"
value="hello"
type="text"
/>
<input
id="canttell7"
style="background: #000; color: #000"
value="hello"
type="button"
/>
<input
id="canttell8"
style="background: #000; color: #000"
value="hello"
type="submit"
/>
<input
id="canttell9"
style="background: #000; color: #000"
value="hello"
type="reset"
/>
<select id="canttell10" style="background: #000; color: #000">
<option>Hello</option>
</select>
<textarea id="canttell11" style="background: #000; color: #000">hello</textarea>
<input
id="canttell12"
type="button"
style="background: #000; color: #000"
value="hello"
/>
<input
id="canttell13"
type="reset"
style="background: #000; color: #000"
value="hello"
/>
<input
id="canttell14"
type="submit"
style="background: #000; color: #000"
value="hello"
/>
<input id="canttell15" style="background: #000; color: #000" value="hello" />
<div
id="canttell16"
style="background: #000; color: #000"
role="alert"
aria-disabled="false"
>
hello
</div>
<div id="canttell17" style="background: #000; color: #000" aria-hidden="true">
text
</div>
<div style="background-color: white; height: 60px; width: 80px">
<div id="canttell18" style="color: white; height: 40px; width: 60px">Hi</div>
</div>
<div
style="background-color: white; height: 60px; width: 80px; overflow: scroll"
>
<div
id="canttell19"
style="margin-left: 80px; color: white; height: 80px; width: 90px"
>
Hi
</div>
</div>
<div style="background-color: #fff">
<div id="canttell20" style="color: #ddd">
₠ ₡ ₢ ₣
</div>
</div>
<div style="width: 0; height: 50px; overflow: scroll">
<div id="ignore7" style="width: 200px; height: 200px; background-color: blue">
Hello World
</div>
</div>
<p
style="
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 200px;
background-color: #fff;
"
>
<span id="pass9" style="color: #000">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et sollicitudin
quam. Fusce mi odio, egestas pulvinar erat eget, vehicula tempus est. Proin
vitae ullamcorper velit. Donec sagittis est justo, mattis iaculis arcu
facilisis id. Proin pulvinar ornare arcu a fermentum. Quisque et dignissim
nulla, sit amet consectetur ipsum. Donec in libero porttitor, dapibus neque
imperdiet, aliquam est. Vivamus blandit volutpat fringilla. In mi magna,
mollis sit amet imperdiet eu, rutrum ut tellus. Mauris vel condimentum nibh,
quis ultricies nisi. Vivamus accumsan quam mauris, id iaculis quam fringilla
ac. Curabitur pulvinar dolor ac magna vehicula, non auctor ligula dignissim.
Nam ac nibh porttitor, malesuada tortor varius, feugiat turpis. Mauris
dapibus, tellus ut viverra porta, ipsum turpis bibendum ligula, at tempor
felis ante non libero.
</span>
</p>
<div
id="text-container"
style="
overflow: hidden;
background-color: teal;
height: 30px;
width: 200px;
margin-bottom: 60px;
"
>
<span id="fail8" style="color: grey"
>this is a span with some text inside of it</span
>
<span id="fail9" style="color: grey"
>this is a span with some text inside of it</span
>
<span id="ignore8" style="color: grey"
>this is a span with some text inside of it</span
>
<span id="ignore9" style="color: grey"
>this is a span with some text inside of it</span
>
</div>
<details>
<summary id="pass10">Summary</summary>
<span id="ignore10">Some text</span>
</details>
<details open>
<summary id="pass11">Summary</summary>
<span id="pass12">Some text</span>
</details>
<div style="background: #222">
<div
style="
background-color: white;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 300px;
"
>
<span id="pass13"
>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.</span
>
</div>
</div>
<div style="background-color: #222; height: 40px; width: 100px"></div>
<div style="margin: -40px 0 40px" id="fail10">Hello world</div>
<div
style="
overflow: hidden;
width: 300px;
height: 200px;
background: #222;
margin-bottom: 150px;
"
>
<div style="overflow: hidden; position: relative; left: 100px">
<div id="fail11" style="position: relative; top: 100px">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.
</div>
</div>
</div>
<ul>
<li id="pass14">
Lorem
<ul>
<li id="pass15">Ipsum</li>
</ul>
</li>
</ul>
<ul style="font-size: 14px; line-height: 1.6em">
<li id="pass16">
Test
<ul>
<li></li>
</ul>
</li>
<li id="pass17">
Lorem <strong id="pass18">ipsum</strong>.
<ul>
<li></li>
</ul>
</li>
</ul>
<label id="pass19"
>Do you like peas?
<input id="pass20" name="peas" style="width: 100%" />
</label>
<p style="color: #ccc; -webkit-text-stroke: 0.03em #444" id="pass21">
Text-stroke 0.03em
</p>
<p style="color: #ccc; -webkit-text-stroke: 0.02em #444" id="fail12">
Text-stroke 0.02em
</p>
<div
id="backdrop"
style="
position: absolute;
z-index: 1;
height: 40px;
background: #333;
width: 100%;
"
></div>
<div style="display: flex">
<div style="background: white; z-index: 1">
<span id="pass22">This div will be on top of the stack</span>
</div>
</div>
<div id="ignore11" style="background: #000; color: #333" inert>hello</div>
<div inert>
<div>
<div id="ignore12" style="background: #000; color: #333">hello</div>
</div>
</div>
<div
id="pass23"
style="
color: #000;
background: #737373;
text-shadow: color(display-p3 1 1 1 / 1) 0 0 3px;
"
>
Hello world
</div>
<div style="overflow: hidden; width: 50px">
<div style="overflow: hidden; width: 25px">
<div id="ignore13" style="padding-left: 65px">Hello World</div>
</div>
</div>