Skip to content

Input placeholder lacks sufficient contrast ratio - a11y#8044

Merged
Wagner3UB merged 5 commits intomainfrom
input-placeholder-a11y
May 5, 2026
Merged

Input placeholder lacks sufficient contrast ratio - a11y#8044
Wagner3UB merged 5 commits intomainfrom
input-placeholder-a11y

Conversation

@Wagner3UB
Copy link
Copy Markdown
Contributor

Description:

Fixes #8043

What changed:

In themes/default/globals/site.variables:

@inputColor changed from @textColor to #000000, making it explicit and independent from the global text color

@inputPlaceholderColor changed from lighten(@inputColor, 75) to lighten(@inputColor, 45), darker default placeholder for sufficient contrast

@inputPlaceholderFocusColor changed from lighten(@inputColor, 45) to lighten(@inputColor, 75), lighter on focus, correctly making the placeholder less prominent once the field is active

In themes/pastanaga/globals/site.variables:

Removed hardcoded @inputPlaceholderColor: #B8C6C8 and the entire /* Input Text Color */ block, these values are now correctly inherited from the default theme

Why:

The previous configuration had two problems:

The hardcoded #B8C6C8 in Pastanaga failed WCAG 2.1 contrast requirements, not reaching even Level A
The focus/default placeholder logic was inverted, the focused state was darker than the default

Visual impact:

This is a visual breaking change. All input placeholders using @inputPlaceholderColor and @inputPlaceholderFocusColor will have their colors inverted. Custom themes overriding these variables are not affected.

Examples:

Share page input
without focus:
input-without-focus

with focus:
input-with-focus

Site search without and with focus inside:
site-search-without-focus
site-search-with-focus

Copy link
Copy Markdown
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this minor change to the news, I approve. Thank you!

Comment thread packages/volto/news/8044.bugfix Outdated
@github-project-automation github-project-automation Bot moved this from In progress to Review in progress in RedTurtle priorities Mar 23, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Review in progress in Accessibility Mar 23, 2026
@Wagner3UB Wagner3UB requested review from wesleybl and removed request for robgietema and sneridagh April 28, 2026 14:37
Comment thread packages/volto/theme/themes/default/globals/site.variables Outdated
Comment thread packages/volto/theme/themes/default/globals/site.variables Outdated
@Wagner3UB Wagner3UB force-pushed the input-placeholder-a11y branch from a2be3b6 to 01885df Compare May 4, 2026 12:48
@Wagner3UB Wagner3UB requested review from stevepiercy and wesleybl May 4, 2026 14:50
Copy link
Copy Markdown
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be backported to 18, too.

One note, we've ripped out Semantic UI for Seven, so it would be good to check on the seven branch if this fix is needed, and if so, then adapt it to the new theming system. This would be a good sprint task. Maybe @pnicolli or @sneridagh can point y'all toward the proper CMSUI theming story. I found this: https://volto.readthedocs.io/seven/conceptual-guides/seven-vs-volto-differences.html#tailwind-css

@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in RedTurtle priorities May 4, 2026
@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Accessibility May 4, 2026
@Wagner3UB
Copy link
Copy Markdown
Contributor Author

I think this should be backported to 18, too.

One note, we've ripped out Semantic UI for Seven, so it would be good to check on the seven branch if this fix is needed, and if so, then adapt it to the new theming system. This would be a good sprint task. Maybe @pnicolli or @sneridagh can point y'all toward the proper CMSUI theming story. I found this: https://volto.readthedocs.io/seven/conceptual-guides/seven-vs-volto-differences.html#tailwind-css

@stevepiercy It will. Just to let you know, all our accessibility interventions will be present in both versions 18 and 19, without exception. Our goal at RedTurtle is to have these fixes ready for version 18 soon, followed by version 19 after its official release.

@Wagner3UB Wagner3UB merged commit 9bca14b into main May 5, 2026
78 checks passed
@Wagner3UB Wagner3UB deleted the input-placeholder-a11y branch May 5, 2026 12:18
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in RedTurtle priorities May 5, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Accessibility May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

3 participants