You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Input borders should meet the WCAG AA contrast ratio requirements #7509
changed the title [-]Input borders should meet the contrast ratio guidelines[/-][+]Input borders should meet the WCAG AA contrast ratio requirements[/+]on Feb 5, 2024
Worth noting: the password component is dark enough to pass the contrast check - why is it a one-off?
I noticed that this is true when the dual, or preppend or append parameters are set to true. It seems that this happens because the background of these added elements use a lighter gray (which is the same as the field's border)
I'd recommend reading through Understanding SC 1.4.11: Non-text Contrast (Level AA) for inspiration. There's a lot of visual examples of how the 3:1 contrast ratio for non-text elements can be accomplished. This will probably result in form inputs that look "heavier" because of the increased saturation of the border, but that's a trade-off we'll have to make. Whatever colors are settled on, we can quickly retest locally in PR for light and dark mode compliance.
It looks like the solution is to simply increase the contrast of the border around these inputs. I think the solution is relatively straight-forward. I think we could probably spike something out and deploy it to a test environment and have @kyrspl and @MichaelMarcialis review it.
I couldn't find where exactly in the code we apply it but it appears to be a box-shadow.
I think the level of effort here is relatively small but verifying it in Kibana properly will probably take a little extra time.
@1Copenut - Regarding buttons --> How should we interpret the contrast requirement of text vs background color?
Are we compliant with the contrast of text alone or do we also need to increase contrast with the border/background as well?
@kyrspl WRT buttons, as long as your text is 3:1 to the background, you'll be in compliance. The button groups I was looking at has a border color that's approximately #EAE9E8 which works out to a contrast ratio of 1.21:1 with the white background. That's the metric I'm interested in, bumping that to 3:1.
We've done some investigation on our side. The effort required here to meet the 3:1 contrast requirement for all inputs in Kibana is quite large. The challenges are as follows:
The scope of core changes to EUI
On the EUI side, we would need to update all of our interactive elements: so not just text inputs as mentioned here, but also buttons, select components, icon button, panels that act as buttons, and I'm sure there's more I haven't mentioned here. It's not just about borders, we also need to consider things like secondary buttons that use a light shade as their background with no border, or components like EuiEmptyButton, which use no background or border at all.
In order to proceed we'd need a complete list of changes required at a per-component level.
Ripple effects in Design
Increasing contrast of input elements changes the look and feel of the entire design. Quite frankly, the interface stops looking, feeling, and working as intended with dramatic contrast changes to interactive elements.
In order to proceed, we'd need to re-evaluate the entire design of EUI and Kibana to account for these contrast changes.
Interactive elements outside of EUI
Changing EUI (by my rough estimate) may solve this issue for 50% to 80% of Kibana. However, there are many interactive elements that are created independently in Kibana outside of EUIs control.
In order to proceed, there will need to be a concerted effort to udpate the remainder of interactive elements in Kibana that are outside of EUI.
Risk to adoption
If we were to proceed with updating our theme to be compliant with SC 1.4.11, there is a high likely-hood that we will get pushback from our core product and design stakeholders. This is a dramatic change and the overall end product may be perceived as a degradation in overall design quality.
To proceed, we need to consider whether or not this would be a change to our core theme, or whether this could be implemented as an opt-in high-contrast user setting.
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.
Activity
[-]Input borders should meet the contrast ratio guidelines[/-][+]Input borders should meet the WCAG AA contrast ratio requirements[/+]cee-chen commentedon Feb 5, 2024
Worth noting: the password component is dark enough to pass the contrast check - why is it a one-off?
kyrspl commentedon Mar 26, 2024
@cee-chen
I noticed that this is true when the
dual, orpreppendorappendparameters are set to true. It seems that this happens because the background of these added elements use a lightergray(which is the same as the field'sborder)JasonStoltz commentedon Jul 18, 2024
When this is finished, we'll need to update and verify elastic/kibana#176219
1Copenut commentedon Jul 22, 2024
I'd recommend reading through Understanding SC 1.4.11: Non-text Contrast (Level AA) for inspiration. There's a lot of visual examples of how the 3:1 contrast ratio for non-text elements can be accomplished. This will probably result in form inputs that look "heavier" because of the increased saturation of the border, but that's a trade-off we'll have to make. Whatever colors are settled on, we can quickly retest locally in PR for light and dark mode compliance.
JasonStoltz commentedon Jul 23, 2024
It looks like the solution is to simply increase the contrast of the border around these inputs. I think the solution is relatively straight-forward. I think we could probably spike something out and deploy it to a test environment and have @kyrspl and @MichaelMarcialis review it.
I couldn't find where exactly in the code we apply it but it appears to be a
box-shadow.I think the level of effort here is relatively small but verifying it in Kibana properly will probably take a little extra time.
1Copenut commentedon Jul 23, 2024
@JasonStoltz Looking at this a second time, we'll need to consider the border on additional items including:
I'm probably missing some, but the gist is these gray elements with a shade darker gray border or separator should be part of this work.
1 remaining item
kyrspl commentedon Jul 29, 2024
@1Copenut - Regarding buttons --> How should we interpret the contrast requirement of text vs background color?
Are we compliant with the contrast of text alone or do we also need to increase contrast with the border/background as well?
1Copenut commentedon Jul 29, 2024
@kyrspl WRT buttons, as long as your text is 3:1 to the background, you'll be in compliance. The button groups I was looking at has a border color that's approximately
#EAE9E8which works out to a contrast ratio of 1.21:1 with the white background. That's the metric I'm interested in, bumping that to 3:1.cee-chen commentedon Jul 30, 2024
#7930 has a spike of this work if y'all would like to review the changes here:
cee-chen commentedon Jul 30, 2024
@1Copenut Question, does EuiSelectable also now require a border at all times, with increased contrast? https://eui.elastic.co/pr_7930/#/forms/selectable
1Copenut commentedon Jul 30, 2024
@cee-chen
Yes, I believe it does. It's got the same light gray border and divider between
optionsso would fall under the same non-text contrast requirement.JasonStoltz commentedon Jul 31, 2024
We've done some investigation on our side. The effort required here to meet the 3:1 contrast requirement for all inputs in Kibana is quite large. The challenges are as follows:
The scope of core changes to EUI
On the EUI side, we would need to update all of our interactive elements: so not just text inputs as mentioned here, but also buttons, select components, icon button, panels that act as buttons, and I'm sure there's more I haven't mentioned here. It's not just about borders, we also need to consider things like secondary buttons that use a light shade as their background with no border, or components like EuiEmptyButton, which use no background or border at all.
In order to proceed we'd need a complete list of changes required at a per-component level.
Ripple effects in Design
Increasing contrast of input elements changes the look and feel of the entire design. Quite frankly, the interface stops looking, feeling, and working as intended with dramatic contrast changes to interactive elements.
In order to proceed, we'd need to re-evaluate the entire design of EUI and Kibana to account for these contrast changes.
Interactive elements outside of EUI
Changing EUI (by my rough estimate) may solve this issue for 50% to 80% of Kibana. However, there are many interactive elements that are created independently in Kibana outside of EUIs control.
In order to proceed, there will need to be a concerted effort to udpate the remainder of interactive elements in Kibana that are outside of EUI.
Risk to adoption
If we were to proceed with updating our theme to be compliant with SC 1.4.11, there is a high likely-hood that we will get pushback from our core product and design stakeholders. This is a dramatic change and the overall end product may be perceived as a degradation in overall design quality.
To proceed, we need to consider whether or not this would be a change to our core theme, or whether this could be implemented as an opt-in high-contrast user setting.
github-actions commentedon Feb 23, 2025
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.
JasonStoltz commentedon Mar 25, 2025
I am going to close this as we have add High-Contrast mode which should alleviate the original concern raised in the linked Kibana issue.