Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
Claro theme
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Dec 2018 at 20:20 UTC
Updated:
9 May 2022 at 23:59 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
antonellasevero commentedComment #3
huzookaThis issue is in, see this commit
Comment #4
huzookaComment #6
saschaeggiComment #7
modulist commentedPlaceholders
Color contrast
The placeholder text color does not meet the 4.5:1 minimum color contrast specified by WCAG 2.0 AA guideline 1.4.3.
Recommendation:
Use #757575 or darker for placeholder text.
Comment #8
modulist commentedData type for input
The placeholders on the fields should hint at the type of data: plain text, dates, phone numbers, postal codes, using either X or as the placeholder character.
Examples
MM-DD-YYYY
(999) 999-9999
99999-9999
Also, the data type should be specified whenever possible to make data entry easier on handheld devices.
Comment #9
modulist commentedDisabled form fields
Color contrast in disabled form fields is too low with white background.
Recommendations:
The input label text should be equivalent to #757575 or darker on white to have required 4.5:1 color contrast.
The disabled border should have a minimum 3:1 color contrast with the background. An alternative would be to use a darker color with dotted or dashed borders for disabled fields in the visual language.
Comment #10
modulist commentedFocus states
Outlines should be wider to provide more visual contrast for low vision users.
Comment #11
lauriiiMoving back to active based on recent feedback from @modulist.
Comment #12
lauriiiCrediting @modulist for the accessibility review. Thank you!
Comment #13
huzooka#7 I cannot agree. If the placeholder color is too close to the real input text color, I cannot distinguish which inputs I filled and which ones not. And – IMHO – thats a bigger usability error.
#8 I used a really basic test project to be able to automate screenshot creation. If this is a real issue, that it's a core issue. We won't change placeholders or add new ones in this project as I know right now.
#10 The style that checkboxes or radios have could work? Screenshots here.
Comment #14
huzookaExample for #7 from seven: the input in the table is empty, what you see there is the placeholder text.
Comment #15
modulist commented@huzooka I understand your reservations on placeholder colors from a UX point of view, and I felt them as well when I first started working with accessibility. However, they do present a readability issue for users with low vision or even fully-sighted users looking at a low-contrast screen (like a smartphone in broad daylight).
The WCAG standards are what they are, so having insufficient contrast will be a recurring weak point and easy point of attack on Drupal's accessibility.
Seeing as how we are building an authoring tool to be used by millions, we need to play it extra safe with WCAG and ATAG compliance.
Comment #16
modulist commentedWe should think out of the box in terms of how we make placeholder text look different from user-submitted input. We have a blank canvas to try out location, border width, icons, an asterisk or arrow preceding the placeholder.
Here is an article that explores some of the more conservative alternatives:
https://uxdesign.cc/alternatives-to-placeholder-text-13f430abc56f
Comment #17
saschaeggi@modulist as far as I understand the WCAG guidelines and also got feedback from my local Accessibility community – if there is a label which clearly states what the user can input then it can/will be considered as incidental.
Would you agree?
Btw the contrast currently used is 3.12:1. Thanks for another feedback :)
Comment #18
huzooka@modulist the issue I described in #13 about the placeholder color affects low vision users the best.
I totally understand your point (following WCAG), but I still think that we may and should reconsider the outcome.
My personal opinion is that the goal here is not (just) following the guidelines, but provide the best possible accessibility level.
Comment #19
bnjmnmThis patch is a possible way to address the accessibility issues mentioned above. Fully aware that these changes aren't in the spec - providing them to be looked over here and if they seem like a good approach the conversation can continue in the appropriate places.
Here's a summary:
For placeholder text (#8), the color was changed to #757575 to get the necessary contrast. To better distinguish it from user input, the text is italicized and the size reduced by 10%

For focus states (#10), the border width is increased from 1px to 2.5px.

For disabled fields (#9), the border is dashed and color is an adequate-contrast achieving #757575, the label is also #757575. The field background color is #f2f2f3 and the form value color is #6e6e6e, which has a ratio of 4.55:1

Comment #20
ant1Is this still an issue? What needs to be done to set this as Fixed?
Comment #21
ckrinaYes, currently placeholfers are using
#8e929cand it doesn't have enough contrast.As @modulist pointed on comment #15 WCAG 1.4.3 success criteria of 4.5:1 contrast ratio applies to placeholders too (it's clearly specified on WCAG specification he linked to).
So moving this to Needs design&Needs work since we need to come up with a better solution for placeholders, where we need to take into account comment #16 by modulist and the proposal by @bnjmnm on comment #19.
Comment #22
ckrinaChanging the title to better reflect the current requirements of this issue. The issue summary should be changed too.
Comment #23
saschaeggiI've updated the input component accordingly. We're using now:
Placeholder: italic, #6E727B (new color: $color-disabled-text)
Filled: text #222330
Disabled: 1px dotted $color-gray-blue, text color: $color-disabled-text, also the label is now $color-disabled-text
See https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system...
Comment #24
saschaeggiThis change should be reflected for inputs, textarea, selects, radio and checkbox (so all input elements).
Added a "updated" flag to indicate the change
Comment #25
huzookaShouldn't we create a new follow-up for this instead of changing the title, the summary and the scope of this issue?
Comment #26
lauriii+1 to a follow-up.+1 to continuing discussion here based on Slack conversation 😂Comment #27
ckrinaComment #28
huzookaComment #29
ckrinaWe discussed a bit more about the color to use for the placeholder and we got to use the #727780. Here's the normal screenshot:
And one for the disabled version. Would this be OK on an accessibility point of view?
Comment #30
saschaeggiUpdated it in the design system accordingly.
Comment #31
fhaeberleUpdated the values in the frontend accordingly. :) Since Claro is in core I didn't provide a patch. Hopefully, I'm doing it right and this patch works as expected.
Comment #32
fhaeberleComment #33
huzookaWe still need design for the placeholder of disabled fields. Figma has example only for a disabled input with some value.
Comment #34
saschaeggi@huzooka The placeholder for disabled should be the same as the default placeholder (color disabled-text)
Comment #35
lauriiiComment #36
ant1Comment #37
bnjmnmI know these have opacity in Figma, but they really should be the hex code of whatever color they happen to be when they're on a white background. The screenshot in #29 suggests that was the intent. If the inputs aren't on a page with a #FFF BG, the results are often unreadable and/or very strange looking.
Also, if the link in Figma is the agreed design, could the issue summary be updated with a link to that and "Determine the new design solution" crossed out?
Comment #38
lauriiiComment #39
ant1Has anyone an idea what these hex colors values should be (or where they're defined)?
Comment #40
bnjmnmThe top answer here provides a good explanation if anyone is curious, and these are the values:
rgba(212, 212, 218, 0.3)on white is#f2f2f3rgba(130, 130, 140, 0.5)on white is#c0c0c5Comment #41
ant1Thanks for tip!
I've updated the values.
Comment #42
ant1Comment #43
fhaeberleAfter some tests it looks good to me. The latest change converts the rgba() colors to hex values in case of consistency. Also remove tag because accessibility review is done. Setting it to RTBC
Comment #44
fhaeberleComment #46
xjmThanks for working on Claro's accessibility!
It looks like the patch no longer applies, so needs a reroll (again).
Comment #47
ravi.shankar commentedI have added re-roll of patch #41.
Comment #48
priyanka.sahni commentedComment #49
priyanka.sahni commentedVerified and tested by applying the patch #47.Attached the accessibility report as well.
After Patch UI -

After Patch Accessibility report -

After Patch Accessibility report -

After Patch Style values -

Comment #51
fhaeberleComment #52
mgiffordComment #55
rkollerComment #56
ckrinaMoving this to Needs works after #3154539: Implement new Gray scale on Claro has made it. The patch needs re-roll and the colors updated.
Comment #57
ckrinaThis would need to change the current color defined in
variables.pcss.cssfrom--input-fg-color--placeholder: var(--color-gray-500);to--color-gray-700, with a contrast ratio of4.53:1.Comment #58
andregp commentedChanged the variables.pcss.css file as per #57 and the ran
yarn run build:cssinside core to get this path.Comment #60
cindytwilliams commentedI'm not sure why the tests failed for patch #58, so I just queued them to run again.
I was able to apply this patch cleanly. It updated the input placeholder color to --color-gray-700 (#75767b) and Wave reported no color contrast errors.
Marking RTBC.
Comment #61
rkollerthanks for the patch! i've also successfully applied the patch on a Drupal 9.4.x-dev install on MacOS 10.13.6. I've tested with Safari 13.1.2 and the latest Firefox, Chrome and Edge. Looks good in all of them except Firefox (Version 99.0.1) but i honestly don't know why.
the color value for the placeholder text looks correct with #75767b as well as the computed value with rgb(117, 118, 123) but if you compare the visual output of the placeholder text with the one for example in chrome then it is significantly lighter? :/ (* and i've cleared the caches several times in Firefox)
Comment #62
saschaeggi@rkoller Firefox sets an opacity less than 1. So it can be fixed with
opacity: 1;Comment #63
saschaeggiChanged the patch from #58 to include the
opacity: 1;for::placeholderand adding the changes to the source files which was missing.Comment #64
rkollerthanks for the explanation in regards of the behaviour of Firefox @saschaeggi ! i've retested in Firefox and the visual representation is on par with the other browsers i've also retested.

and tests are green as well so i'll set the issue back to RTBC
Comment #65
rkollerComment #66
ckrinaComment #69
ckrinaCommitted 3bcfafc and pushed to 10.0.x and 9.4.x. Thanks!