Search topics
Low-contrast form fields, checkboxes and icons
Field borders, checkbox boxes and icon buttons are drawn in colours too close to what is behind them: a pale grey on white, or white over a photo.
border: 1px solid #e0e0e0 The problem
People with low vision can't find the search field, the filter checkbox or the carousel arrows
A store's header has a search field, and under it an "In stock only" filter with a checkbox. The home page has a product carousel with previous and next arrows over the photo. It goes wrong in one of two common ways.
In the first, the search field's border is a pale grey line on white, so the field looks like empty space with some placeholder text in it. The checkbox is drawn with the same pale border, so until it is ticked, "In stock only" reads as a line of text with a faint square beside it.
In the second, the arrows are white chevrons with nothing behind them. Over a dark photo they show; over the pale linen of this one, they are hard to make out.
Each control is identified by something other than text: the field by its border, the checkbox by its box, and the arrows by their icon shape. WCAG 1.4.11 asks for at least 3:1 between that visual information and the colours next to it. Each is drawn in a colour too close to the one behind it:
- Field border:
#e0e0e0on white, at 1.32:1. - Checkbox box: the same
#e0e0e0on white, at 1.32:1. Once ticked, the dark fill identifies it, but an empty box is the state people need to find in order to tick it. - Arrows:
#ffffffover the photo, at 1.54:1 against its light linen,#dfceb8, beside the next arrow.
Both pale borders often come from one token: a single light border colour shared by every field and checkbox, chosen to look quiet on the design's white.
The same happens to anyone on a dim or low-quality screen, or in bright sunlight.
1 of 10 groups affected
- No vision (not affected)
- Low vision (affected)
- Colour vision (not affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (not affected)
- Reach, strength (not affected)
- Cognitive (not affected)
- Seizures (not affected)
- Limited vision People with low vision can't find the search field to click into, can't tell that In stock only is a checkbox, and can't see that the carousel has arrows at all. With screen magnification, the faint edge is all they see of a control.
Most scanners check text contrast only. They don't measure a field's border, a checkbox drawn with appearance: none, or an SVG icon's fill. The audit does measure the edges of text fields and the colour of icon-only controls, and finds the pale search field and the white arrows here. It skips checkboxes and radio buttons, so the pale box needs a person with a contrast checker. Icons over images are still the hardest: the result depends on which photo is behind them, and a carousel changes that photo every few seconds, so a check on the first slide says nothing about the next. A generated design can pass on the mock-up's background and fail on the real one.
Try it
Find the search field, the In stock only checkbox and the photo’s arrows
Broken 1: the field’s border and the empty checkbox’s box are a pale grey on white. Can you see where to type, and that the filter can be ticked?
Broken 2: the arrows are white, straight on the photo. Can you see how to change the slide?
Apply the fix. The edges are darker, and the arrows sit on white discs.
Broken Can you fix this?
The fix
Give each field edge, checkbox and icon 3:1 contrast
Field and checkbox edges in a pale grey
:root { --control-edge: #e0e0e0; /* 1.32:1 on white */}.search-input { border: 1px solid var(--control-edge); background: #fff;}.filter-check { appearance: none; width: 20px; height: 20px; border: 1px solid var(--control-edge); border-radius: 4px; background: #fff;}.filter-check:checked { border-color: #1a1a1a; background: #1a1a1a url("check.svg") center no-repeat;}.carousel-arrow { color: #1a1a1a; background: #fff; border-radius: 50%;}What is wrong2 points
- The search field's border barely shows. The edge token,
#e0e0e0, is only 1.32:1 on white, where a field's edge needs 3:1. - The empty checkbox is hard to see, and only a ticked one stands out. Its box takes the same token, so it is only 1.32:1 too, below the 3:1 it needs.
:root { --control-edge: #767676; /* 4.54:1 on white */}.search-input { border: 1px solid var(--control-edge); background: #fff;}.filter-check { appearance: none; width: 20px; height: 20px; border: 1px solid var(--control-edge); border-radius: 4px; background: #fff;}.filter-check:checked { border-color: #1a1a1a; background: #1a1a1a url("check.svg") center no-repeat;}.carousel-arrow { color: #1a1a1a; background: #fff; border-radius: 50%;}@media (forced-colors: active) { .carousel-arrow { border: 1px solid ButtonText; }}How it is fixed3 steps
- Set the edge token to
#767676, 4.54:1 on white. The search field's border and the empty checkbox's box both take it, so one change fixes both. - Put each arrow on a solid white disc, with a dark chevron: 17.40:1 against the disc, on any photo.
- In forced colors, give the arrows a
ButtonTextborder, so the disc still has an edge when its white fill is replaced.
This fixes both Befores and passes 1.4.11.
A field doesn't always need a full border. A filled field with a clear underline, or a fill that reaches 3:1 against the page, also identifies it. Placeholder text does not: it disappears when someone types, and it is usually too pale itself.
A checkbox the browser draws, left unstyled, is exempt, since its look is set by the browser, not the author. Once it is restyled with appearance: none, its box is the author's and needs 3:1. The tick needs 3:1 against the box's fill too, and a radio button's dot against its circle.
Over a photo, the disc is what makes the icon independent of the picture: the chevron is measured against the disc, and the photo around the disc no longer matters. A darker scrim along the photo's edge can work for white icons, but only if it keeps 3:1 under every photo the carousel can show; check the lightest one.
Disabled controls are exempt from 1.4.11. A control that only looks disabled and can still be clicked is not exempt; make it actually disabled, or give it full contrast. Some component libraries set these colours in their own theme, so change the theme tokens rather than overriding each component. A dark theme needs its own value for every edge and icon, as dark mode with faint grey text and icons shows.
The focus ring is under the same criterion, measured against the surface it sits on: low-contrast focus rings against the background covers it.
Design ideas
A control can be quiet and still be found
Six more ways to draw the store’s search field, its header icons and the arrows over its photos. Point at each one, click into the fields and Tab through them: three can be found at rest, and three only by someone who already knows where to look.
In the design file
- Write the contrast ratio next to each field’s border or underline colour, at least 3:1 against the page.
- Draw each checkbox empty as well as ticked, with the empty box’s ratio against the page written beside it, at least 3:1.
- Put each icon that sits on a photo on a solid background shape, and check it on the lightest and the darkest photo the slideshow can show.
- Draw the page in a Windows contrast theme, where the fields, checkboxes and icons must still show.
Passes
- Soft fill with a dark underline A #f2f2f2 fill gives the field a calm block of colour, but at 1.12:1 against the page it can’t mark the field alone. The 2px #1a1a1a line under it does, at 17.40:1.
- Maple & ThreadA white pill on a dark header On the #1a1a1a header a plain white field needs no border: its fill is 17.40:1 against the header, the brightest thing in the bar.
- Icons with no circle or border The #1a1a1a glyph alone marks each control, at 17.40:1 on white, so the header stays light. A #f2f2f2 disc appears on hover, and focus still gets its ring, since a control with no edge still needs a visible focus.
Fails
- A soft fill and nothing elseWCAG 1.4.11 The #f2f2f2 fill with no edge is 1.12:1 against the page, and a field marked only by its fill needs 3:1. A 2px #1a1a1a line under it, or a #767676 edge at 4.54:1, keeps the same soft look.
- Thin pale grey iconsWCAG 1.4.11 Thin #b3b3b3 icons look airy, but at 2.10:1 on white they miss the 3:1 an icon needs when it is the only sign of the control. A #1a1a1a glyph keeps the same thin line.
Glassy arrows over the photoWCAG 1.4.11 A frosted circle of 35% white with a white chevron looks light over a dark photo, but the photo decides: over this one’s pale #dfceb8 the chevron is 1.31:1 against its circle, and the arrow is gone. A solid white circle with a #1a1a1a chevron, 17.40:1, keeps the round shape on any photo.
Verify the fix
5 checks, no mouse.
Test with: Contrast measurement, Zoom, Forced colors
Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the theme tokens or shared component styles change.
Limits
This is a starting pattern, not a guarantee for every application. Colour values and token names are examples; measure your own palette on your real backgrounds. A contrast ratio is a minimum, not proof that a control is easy to find. What a contrast theme does to the same controls is covered in high contrast mode hiding focus, icons and selections. Check the complete pages with people who have low vision.
This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.
EaseWeb service
Fixed it? Keep it from coming back.
I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.