Skip to content

Commit 50ebb91

Browse files
docs-botCopilotheiskr
authored
fix: improve survey form input border contrast for WCAG 1.4.11 (#61263)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
1 parent eda3f9a commit 50ebb91

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/events/components/Survey.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@
1414
text-decoration: underline;
1515
}
1616
}
17+
18+
// Override Primer's form-control border color to meet WCAG 1.4.11 Non-Text Contrast
19+
// (requires 3:1 contrast ratio against adjacent colors).
20+
// The default Primer light-theme border (#d0d7de / #dce1e6) has only ~1.3–1.7:1 contrast
21+
// against a white background. Using --fgColor-muted provides sufficient contrast in all themes.
22+
// See: https://github.com/github/accessibility-audits/issues/16368
23+
.accessibleBorder {
24+
border-color: var(--fgColor-muted, #57606a) !important;
25+
}

src/events/components/Survey.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const Survey = () => {
187187
<span>{t`additional_feedback`}</span>
188188
</label>
189189
<textarea
190-
className="form-control input-sm width-full"
190+
className={cx('form-control input-sm width-full', styles.accessibleBorder)}
191191
name="survey-comment"
192192
id="survey-comment"
193193
value={comment}
@@ -201,7 +201,10 @@ export const Survey = () => {
201201
</label>
202202
<input
203203
type="email"
204-
className="form-control input-sm width-full color-bg-transparent"
204+
className={cx(
205+
'form-control input-sm width-full color-bg-transparent',
206+
styles.accessibleBorder,
207+
)}
205208
name="survey-email"
206209
id="survey-email"
207210
value={email}

0 commit comments

Comments
 (0)