-
Notifications
You must be signed in to change notification settings - Fork 462
[UI-Library][FieldContrastColorPicker] Create a New Accessible Form Component. #11169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UI-Library][FieldContrastColorPicker] Create a New Accessible Form Component. #11169
Comments
Hello @jardakotesovec and @Devika008 ! I created this issue after a few conversations with Michael and Israel, mostly. The idea was to create a Form component that could help anyone who uses it to choose colors that have a good contrast each other. This component is actually an extension of our ColorPicker form component, but with some additional features:
The component is already working, but I'm opening this issue to open a discussion and possible improvements for this component if it's accepted in the future. I'm pinging @mfelczak and @israelcefrin as well as they both participated on the previous discussions too, if they want to add more comments here. Please let me know your thoughts about this component! |
@Godoy0722 Thats great, can you add some screenshots if you have component already working? |
Of course! Here`s the component working I recorded. Gravacao.de.tela.de.2025-03-20.17-45-38.webm |
Hi @Godoy0722, following along on this as I have a general interest in the area. One small suggestion would be a link (or links) that explain more information - for example, we can't assume that the user knows what Level AA/AAA contrast mean, so a way for them to better understand would be useful. It could be a link to our own docs, e.g. https://docs.pkp.sfu.ca/accessible-content/en/principles#contrast-ratio. I was also wondering about the "Enhanced" and "Maximum" levels - those could possibly be removed to simplify the component (if we assume most users concerned about this want to meet one of the standards). If those were removed, then maybe you would want to move the "Text" and "Ratio" area below the colour selectors, perhaps side-by-side instead. |
Hi @Godoy0722 I've installed on my testing instance and it works fine. The info on contrast ratio seems pretty useful and I ditto to @kaitlinnewson on including links to our own docs explaining what is the purpose of keeping a minimum contrast level. Also, I have to say that even though it is possible to use the keyboard to set hex color codes, I couldn't change or set colours using the keyboard only-navigation. I mean, users will always need a mouse to interact with it. Please, notice that you can either manipulate the controls using the mouse or the keyboard. I haven't tested it using my screenreader yet, but I will do it and post my comments as well. |
Hello folks. Just a heads-up that I updated my branch on both ui-library and pkp-lib to improve accessibility. @kaitlinnewson and @israelcefrin, I added your suggestions on the component so you can also take a look at them. Now, you can move both the saturation and the hue pointers with the keyboard. I will still work a bit more on these features as I believe I can improve this behavior, despite it is working now. |
Hello folks! This is just a heads-up that I have been working on major upgrades for this component, which include:
After this, I believe the component is ready to be reviewed. @israelcefrin, @kaitlinnewson , @jardakotesovec , if you want to take a look, you can see these two PRs for this component: Please feel free to reach out to me if you have any questions or suggestions! |
Issue Description
This issue intends to create a form field to help users to choose colors with a good contrast between them.
The FieldContrastColorPicker component provides two color pickers that allow users to select two colors. It calculates the contrast ratio between these colors according to WCAG guidelines and displays flags indicating whether the current contrast meets each WCAG category. Additionally, the component offers a live preview section where the first color is used as the background and the second as the text color.
How to reproduce / Current behavior
npm run build
ornpm run dev
in order to get this component built and ready for use.$color1
and$color2
variables inside the.tpl
files.What application are you using?
OJS 3.5
The text was updated successfully, but these errors were encountered: