@@ -303,7 +303,6 @@ See [[WCAG]] <a href="http://www.w3.org/TR/WCAG20/#time-limits-pause">Guideline
303
303
and <a href="http://www.w3.org/TR/WCAG20/#seizure">Guideline 2.3</a>
304
304
for details.
305
305
306
- <!--
307
306
<div class=example>
308
307
Normally, the caret blinks between on and off.
309
308
This makes it alternate between 2 colors.
@@ -318,17 +317,30 @@ textarea {
318
317
}
319
318
</code></pre>
320
319
321
- The simulated rendering below illustrates how this would look.
320
+ The simulated rendering below illustrates how this should look.
322
321
<style>
323
- @-webkit-keyframes caret-alternate { 50% { border-color: red; } }
324
- @keyframes caret-alternate { 50% { border-color: red; } }
322
+ @-webkit-keyframes caret-alternate-ref { 50% { border-color: red; } }
323
+ @keyframes caret-alternate-ref { 50% { border-color: red; } }
325
324
</style>
326
325
<div style="border:inset; background: white; width: 10em;">
327
326
Text area
328
- with color-alternating caret<span style="border-right: 2px solid blue;animation: caret-alternate 2s step-end infinite;-webkit-animation: caret-alternate 2s step-end infinite;"></span>
327
+ with color-alternating caret<span style="border-right: 2px solid blue; animation: caret-alternate-ref 2s step-end infinite;-webkit-animation: caret-alternate-ref 2s step-end infinite;"></span>
329
328
</div>
329
+
330
+ Focus the element below to see how your browser renders it.
331
+ <style>
332
+ @keyframes caret-alternate-test {
333
+ 50% { caret-color: red; }
334
+ }
335
+ </style>
336
+ <div contentEditable=true
337
+ style="border:inset; background: white; width: 10em;
338
+ caret-animation: none;
339
+ caret-color: blue;
340
+ animation: caret-alternate-test 2s step-end infinite;"
341
+ > Text area with color-alternating caret</div>
330
342
</div>
331
- -->
343
+
332
344
333
345
<h4 id="caret-shape">Shape of the insertion caret: 'caret-shape'</h4>
334
346
@@ -400,19 +412,18 @@ The stacking position of the caret is left undefined, within the following const
400
412
character it overlaps with is not obscured by the caret
401
413
</ul>
402
414
403
- <!--
404
415
<div class=example>
405
416
This illustrates the typical appearance of the various caret shapes.
406
417
In each of the sample renderings below,
407
418
the insertion point is between the letters u and m.
408
419
409
420
<style>
410
- @-webkit-keyframes caret-bar { 50% { outline-color: transparent; } }
411
- @-webkit-keyframes caret-block { 50% { background: transparent; } }
412
- @-webkit-keyframes caret-underscore { 50% { border-color: transparent; } }
413
- @keyframes caret-bar { 50% { outline-color: transparent; } }
414
- @keyframes caret-block { 50% { background: transparent; } }
415
- @keyframes caret-underscore { 50% { border-color: transparent; } }
421
+ @-webkit-keyframes caret-bar-ref { 50% { outline-color: transparent; } }
422
+ @-webkit-keyframes caret-block-ref { 50% { background: transparent; } }
423
+ @-webkit-keyframes caret-underscore-ref { 50% { border-color: transparent; } }
424
+ @keyframes caret-bar-ref { 50% { outline-color: transparent; } }
425
+ @keyframes caret-block-ref { 50% { background: transparent; } }
426
+ @keyframes caret-underscore-ref { 50% { border-color: transparent; } }
416
427
#caret-shape-example {
417
428
min-width: 25em;
418
429
}
@@ -426,16 +437,14 @@ The stacking position of the caret is left undefined, within the following const
426
437
}
427
438
</style>
428
439
<table id="caret-shape-example">
429
- <tr><th> 'caret-shape' <th> Sample rendering
430
- <tr><td> ''bar'' <td> Lorem ipsu<span style="outline: 1px solid black;animation: caret-bar 2s step-end infinite;-webkit-animation: caret-bar 2s step-end infinite;"> ​</span> m
431
- <tr><td> ''block'' <td> Lorem ipsu<span style="background: #bbb; -webkit-animation: caret-block 2s step-end infinite;animation: caret-block 2s step-end infinite;"> m</span>
432
- <tr><td> ''underscore'' <td> Lorem ispu<span style="border-bottom: 2px solid black; -webkit-animation: caret-underscore 2s step-end infinite; animation: caret-underscore 2s step-end infinite;"> m</span>
440
+ <tr><th> 'caret-shape' <th> Sample rendering<th> Your browser <br> (focus each cell to see the caret)
441
+ <tr><td> ''bar'' <td> Lorem ipsu<span style="outline: 1px solid black;animation: caret-bar-ref 2s step-end infinite;-webkit-animation: caret-bar-ref 2s step-end infinite;"> ​</span> m<td style contentEditable=true style="caret-shape: bar"> Lorem Ipsum
442
+ <tr><td> ''block'' <td> Lorem ipsu<span style="background: #bbb; -webkit-animation: caret-block-ref 2s step-end infinite;animation: caret-block-ref 2s step-end infinite;"> m</span><td contentEditable=true style="caret-shape: block"> Lorem Ipsum
443
+ <tr><td> ''underscore'' <td> Lorem ispu<span style="border-bottom: 2px solid black; -webkit-animation: caret-underscore-ref 2s step-end infinite; animation: caret-underscore-ref 2s step-end infinite;"> m</span><td contentEditable=true style="caret-shape: underscore"> Lorem Ipsum
433
444
</table>
434
445
</div>
435
- -->
436
446
437
447
438
- <!--
439
448
<div class=example>
440
449
''caret-shape/underscore'' or ''caret-shape/block'' carets are commonly used
441
450
in terminals and command lines,
@@ -450,17 +459,25 @@ The stacking position of the caret is left undefined, within the following const
450
459
}
451
460
</code></pre>
452
461
462
+ The simulated rendering below illustrates how this should look.
453
463
<style>
454
- @-webkit-keyframes terminal-caret { 50% { border-color: transparent; } }
455
- @keyframes terminal-caret { 50% { border-color: transparent; } }
464
+ @-webkit-keyframes terminal-caret-ref { 50% { border-color: transparent; } }
465
+ @keyframes terminal-caret-ref { 50% { border-color: transparent; } }
456
466
</style>
457
467
<pre style="background: black; color: white; font-family: monospace; padding: 1ex">
458
468
user@host:css-ui-4 $ ls -a
459
469
. .. Overview.bs Overview.html
460
- user@host:css-ui-4 $ <span style="border-bottom: 2px solid white;animation: terminal-caret 2s step-end infinite;-webkit-animation: terminal-caret 2s step-end infinite;"> </span>
470
+ user@host:css-ui-4 $ <span style="border-bottom: 2px solid white;animation: terminal-caret-ref 2s step-end infinite;-webkit-animation: terminal-caret-ref 2s step-end infinite;"> </span>
471
+ </pre>
472
+
473
+ Focus the element below to see how your browser renders it.
474
+ <pre contentEditable=true style="background: black; color: white; font-family: monospace; padding: 1ex; caret-shape: underscore;">
475
+ user@host:css-ui-4 $ ls -a
476
+ . .. Overview.bs Overview.html
477
+ user@host:css-ui-4 $
461
478
</pre>
479
+
462
480
</div>
463
- -->
464
481
465
482
<h4 id="caret">Insertion caret shorthand: 'caret'</h4>
466
483
@@ -480,7 +497,6 @@ This property is a shorthand for setting
480
497
'caret-color' , 'caret-animation' and 'caret-shape' in one declaration.
481
498
Omitted values are set to their initial values.
482
499
483
- <!--
484
500
<div class=example>
485
501
This example illustrates using the various caret related properties
486
502
in combination.
@@ -498,34 +514,39 @@ Omitted values are set to their initial values.
498
514
75%, to { caret-color: transparent; }
499
515
}
500
516
</code></pre>
517
+
518
+ The simulated rendering below illustrates how this should look.
501
519
<style>
502
- # old-screen {
520
+ . old-screen {
503
521
border-radius: 1em;
504
522
padding: 1em;
505
523
color: green;
506
524
font-family: monospace;
525
+ white-space: pre;
507
526
background: repeating-linear-gradient(#030 0px, #030 1px, #020 1px, #020 3px);
508
527
}
509
- # old-screen span {
528
+ . old-screen span {
510
529
display:inline-block;
511
530
white-space: pre;
512
531
caret: block 0s;
513
- animation: caret-old 2s infinite;
514
- -webkit-animation: caret-old 2s infinite;
532
+ animation: caret-old-ref 2s infinite;
533
+ -webkit-animation: caret-old-ref 2s infinite;
515
534
516
535
}
517
- @keyframes caret-old {
536
+ @keyframes caret-old-ref {
518
537
from, 50% { background-color: green; }
519
538
75%, to { background-color: transparent; }
520
539
}
521
- @-webkit-keyframes caret-old {
540
+ @-webkit-keyframes caret-old-ref {
522
541
from, 50% { background-color: green; }
523
542
75%, to { background-color: transparent; }
524
543
}
525
544
</style>
526
- <div id="old-screen" style="height: 100px"> > <span> </span></div>
545
+ <div class="old-screen" style="height: 100px"> > <span> </span></div>
546
+
547
+ Focus the element below to see how your browser renders it.
548
+ <div class="old-screen" contentEditable="true" style="height: 100px"> > </div>
527
549
</div>
528
- -->
529
550
530
551
<h3 id="keyboard">Keyboard control</h3>
531
552
0 commit comments