Skip to content

Commit dd6ef10

Browse files
committed
[css-ui-4] Restore the examples
Put back the examples with -webkit- prefixed fallbacks in them, and also include a live version of the example, using the property defined in the specification, so that readers of the specification can compare the expected rendering the result in their browser.
1 parent b8c3b33 commit dd6ef10

File tree

1 file changed

+53
-32
lines changed

1 file changed

+53
-32
lines changed

css-ui-4/Overview.bs

+53-32
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ See [[WCAG]] <a href="http://www.w3.org/TR/WCAG20/#time-limits-pause">Guideline
303303
and <a href="http://www.w3.org/TR/WCAG20/#seizure">Guideline 2.3</a>
304304
for details.
305305

306-
<!--
307306
<div class=example>
308307
Normally, the caret blinks between on and off.
309308
This makes it alternate between 2 colors.
@@ -318,17 +317,30 @@ textarea {
318317
}
319318
</code></pre>
320319

321-
The simulated rendering below illustrates how this would look.
320+
The simulated rendering below illustrates how this should look.
322321
<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; } }
325324
</style>
326325
<div style="border:inset; background: white; width: 10em;">
327326
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>
329328
</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>
330342
</div>
331-
-->
343+
332344

333345
<h4 id="caret-shape">Shape of the insertion caret: 'caret-shape'</h4>
334346

@@ -400,19 +412,18 @@ The stacking position of the caret is left undefined, within the following const
400412
character it overlaps with is not obscured by the caret
401413
</ul>
402414

403-
<!--
404415
<div class=example>
405416
This illustrates the typical appearance of the various caret shapes.
406417
In each of the sample renderings below,
407418
the insertion point is between the letters u and m.
408419

409420
<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; } }
416427
#caret-shape-example {
417428
min-width: 25em;
418429
}
@@ -426,16 +437,14 @@ The stacking position of the caret is left undefined, within the following const
426437
}
427438
</style>
428439
<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;">&#8203;</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;">&#8203;</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
433444
</table>
434445
</div>
435-
-->
436446

437447

438-
<!--
439448
<div class=example>
440449
''caret-shape/underscore'' or ''caret-shape/block'' carets are commonly used
441450
in terminals and command lines,
@@ -450,17 +459,25 @@ The stacking position of the caret is left undefined, within the following const
450459
}
451460
</code></pre>
452461

462+
The simulated rendering below illustrates how this should look.
453463
<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; } }
456466
</style>
457467
<pre style="background: black; color: white; font-family: monospace; padding: 1ex">
458468
user@host:css-ui-4 $ ls -a
459469
. .. 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;">&nbsp;</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;">&nbsp;</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 $
461478
</pre>
479+
462480
</div>
463-
-->
464481

465482
<h4 id="caret">Insertion caret shorthand: 'caret'</h4>
466483

@@ -480,7 +497,6 @@ This property is a shorthand for setting
480497
'caret-color', 'caret-animation' and 'caret-shape' in one declaration.
481498
Omitted values are set to their initial values.
482499

483-
<!--
484500
<div class=example>
485501
This example illustrates using the various caret related properties
486502
in combination.
@@ -498,34 +514,39 @@ Omitted values are set to their initial values.
498514
75%, to { caret-color: transparent; }
499515
}
500516
</code></pre>
517+
518+
The simulated rendering below illustrates how this should look.
501519
<style>
502-
#old-screen {
520+
.old-screen {
503521
border-radius: 1em;
504522
padding: 1em;
505523
color: green;
506524
font-family: monospace;
525+
white-space: pre;
507526
background: repeating-linear-gradient(#030 0px, #030 1px, #020 1px, #020 3px);
508527
}
509-
#old-screen span {
528+
.old-screen span {
510529
display:inline-block;
511530
white-space: pre;
512531
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;
515534

516535
}
517-
@keyframes caret-old {
536+
@keyframes caret-old-ref {
518537
from, 50% { background-color: green; }
519538
75%, to { background-color: transparent; }
520539
}
521-
@-webkit-keyframes caret-old {
540+
@-webkit-keyframes caret-old-ref {
522541
from, 50% { background-color: green; }
523542
75%, to { background-color: transparent; }
524543
}
525544
</style>
526-
<div id="old-screen" style="height: 100px">&gt; <span>&nbsp;</span></div>
545+
<div class="old-screen" style="height: 100px">&gt; <span>&nbsp;</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">&gt; </div>
527549
</div>
528-
-->
529550

530551
<h3 id="keyboard">Keyboard control</h3>
531552

0 commit comments

Comments
 (0)