Skip to content

Commit 886d333

Browse files
fstrrmbgower
andauthored
Update non-text contrast for caret styling (#4524)
Some of the new [custom caret CSS properties](https://blogs.igalia.com/mrego/playing-with-the-new-caret-css-properties/) are starting to land in browsers. Non-Text Contrast has an example where a text input's border color fails contrast, but still passes the SC due to the presence of the caret / cursor when the input has focus. This update adds a failure example for a failing border color and a caret with a contrast lower than 3:1. --------- Co-authored-by: Mike Gower <[email protected]>
1 parent f45b557 commit 886d333

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
6.11 KB
Loading

understanding/21/non-text-contrast.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Understanding Non-text Contrast</title>
6-
<link rel="stylesheet" type="text/css" href="../../css/editors.css" class="remove">
76
</head>
87
<body>
98
<h1>Understanding Non-text Contrast</h1>
@@ -231,7 +230,7 @@ <h3>User Interface Component Examples</h3>
231230
</tr>
232231
<tr>
233232
<th>Text input focus style</th>
234-
<td>A focus indicator is required. While in this case the additional gray (<code>#CCC</code>) outline has an insufficient contrast of 1.6:1 against the white (<code>#FFF</code>) background, the cursor/caret which is displayed when the input receives focus <em>does</em> provide a sufficiently strong visual indication.</td>
233+
<td>A focus indicator is required. While in this case the additional gray (<code>#CCC</code>) outline has an insufficient contrast of 1.6:1 against the white (<code>#FFF</code>) background, the user-agent's default cursor/caret which is displayed when the input receives focus <em>does</em> provide a sufficiently strong visual indication.</td>
235234
<td>
236235
<img src="img/text-input-focus.png" alt="A label with a text input with a faint gray outline and a visible cursor/caret.">
237236
</td>
@@ -303,6 +302,13 @@ <h3>User Interface Component Examples</h3>
303302
<img src="img/checkbox-example5.png" alt="Unchecked checkbox with a thick gray additional outline as focus indication." width="150">
304303
</td>
305304
</tr>
305+
<tr>
306+
<th>Text input - subtle border and customized caret</th>
307+
<td>The text input's border color (<code>#CCC</code>) has contrast lower than 3:1 against its adjacent white background. Additionally, the caret / cursor has been given a customized light-blue color (<code>#00C7FD</code>) which has a contrast lower than 3:1 against the interior white background color of the input.</td>
308+
<td>
309+
<img src="img/contrast-text-input-custom-caret.png" alt="A text input with a light gray border and a light blue caret." width="375">
310+
</td>
311+
</tr>
306312
</table>
307313

308314
</section>

0 commit comments

Comments
 (0)