Skip to content

Replace hardcoded color values with Semantic UI theme variables - input field - a11y #8043

@Wagner3UB

Description

@Wagner3UB

Description:
The Pastanaga theme has a hardcoded value for @inputPlaceholderColor: #B8C6C8 against a white background (#FFFFFF), which produces a contrast ratio below 3:1, failing even the minimum WCAG 2.1 Level A requirement for UI components and placeholder text.

Additionally, the placeholder color logic is inverted — the focused state is darker than the default, which is counterintuitive: a focused field should make the placeholder less prominent, not more.

Current behavior:
less@inputPlaceholderColor: #B8C6C8; /* hardcoded, contrast ratio < 3:1 on white */

Expected behavior:
Placeholder colors should be derived from @inputColor using relative lightness values, ensuring they meet WCAG contrast requirements and behave correctly across focus states.

Goals:

  • Set the placeholder color as black/@textcolor (@inputColor)
  • Remove the hardcoded input placeholder color
  • Set the placeholder variables correctly - dark color as default, light color on focus (@inputPlaceholderColor, @inputPlaceholderFocusColor)

Related to:
#5127 - DONE/CLOSED
#5144

References:
WCAG 2.1 SC 1.4.3 – Contrast (Minimum)
WCAG 2.1 SC 1.4.11 – Non-text Contrast

Images:

Image Image

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions