Skip to content

Color contrast of placeholder text#3847

Open
Andrea-Guevara wants to merge 2 commits intoDSpace:mainfrom
Andrea-Guevara:IncreasedColorContrast
Open

Color contrast of placeholder text#3847
Andrea-Guevara wants to merge 2 commits intoDSpace:mainfrom
Andrea-Guevara:IncreasedColorContrast

Conversation

@Andrea-Guevara
Copy link
Contributor

References

Description

Improving the color contrast of the placeholder text and the descriptive text “Filter results by typing the first few letters”

Instructions for Reviewers

List of changes in this PR:

  • The text-muted class has been removed from the small/explanatory text placeholder in the starts-with-text component.
  • The color of the placeholder text in the global styling file “_global-styles.scss” has been adjusted.

Check the color contrast of the placeholders with an accessibility tool!

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue added accessibility 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Jan 17, 2025
@tdonohue tdonohue added this to the 9.0 milestone Jan 17, 2025
@hostle83
Copy link

Hi @Andrea-Guevara, just tested this and Silktide still flags the placeholder text and label text as problematic. If you use the Silktide plugin in your browser and run the accessibility checker on this page, you should see what I mean. The ratio is still well below 4.5:1.

@hostle83 hostle83 self-requested a review January 28, 2025 19:47
@Andrea-Guevara
Copy link
Contributor Author

Andrea-Guevara commented Jan 29, 2025

Good morning @hostle83, I hope you're well!

The problem is with the border, it's too thin. If we increase the border of the input, the problem is solved.

Screenshot_80

We would do this as follows:

.form-control, .page-link {
border: 2px solid $gray-700;

&:disabled {
    color: lighten($gray-700, 10%);
}
&::placeholder {
    color: $gray-700;
}
&:focus {
    box-shadow: none;
    outline: 2px solid lighten($gray-700, 10%);
    outline-offset: 2px !important;
}

}

If you like the idea, I can adjust the pull.

@hostle83
Copy link

Hi @Andrea-Guevara, that looks much better to me. If @tdonohue doesn't have any objections, please go ahead and adjust the PR. Thank you!

@hostle83
Copy link

Hey Andrea, I discussed this with @tdonohue and you can please go ahead and adjust the PR. Thank you!

@hostle83 hostle83 moved this from 👀 Under Review to 👍 Reviewer Approved in DSpace 9.0 Release Mar 6, 2025
@hostle83
Copy link

hostle83 commented Mar 6, 2025

Apologies for taking a while to get back to you on this, @Andrea-Guevara
I was able to test it and it looks good, it now passes all accessibility tests in Silktide and Wave!

Copy link

@hostle83 hostle83 left a comment

Choose a reason for hiding this comment

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

Looks good and passes all accessibility tests

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

@Andrea-Guevara : I gave this a look today. While it does solve the basic issues, the thicker border around input boxes looks very odd on some pages, because it's right next to other fields that still have a thin border. Here's some screenshots of what I see:

Pagination buttons have intermixed borders. Some thick, some thin
pagination

Search results has thick border for input, but thin border for "All of DSpace"
searchresults

Browse by Date has thick border for input, but thin border for year/month:
browsedate

I also find the thick border quite odd looking on the Submission form. It looks like all the fields are bolded or highlighted (notice how all the sections having a faint border makes all the fields look bolded)

submission

I don't have a recommendation here yet. But, I feel the darker border is not "matching" well with the rest of the DSpace site. We may need to see if there's a way to make it look less bold or less thick. Or we need to make everything else just as thick (but I'm not sure about that approach either).

The changes to the placeholder text look fine to me though. It's just the new border to these form fields that looks odd. So, another option would be to revert the border changes (for now) until we come up with a better solution & just fix the placeholder text.

@github-project-automation github-project-automation bot moved this from 👍 Reviewer Approved to 👀 Under Review in DSpace 9.0 Release Apr 25, 2025
@tdonohue tdonohue moved this to 👀 Under Review in DSpace 10.0 Release May 19, 2025
@tdonohue tdonohue removed this from the 9.0 milestone May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge accessibility port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release

Projects

Status: 👀 Under Review

Development

Successfully merging this pull request may close these issues.

[Accessibility] Increase of color contrast on parts of site

3 participants