swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.38k stars 8.92k forks source link

a11y: Not enough color contrast in display of input/output schema #9594

Open ghost opened 7 months ago

ghost commented 7 months ago

Q&A (please complete the following information)

Content & configuration

Basic/ default

Describe the bug you're encountering

We are using a tool called Sort Site to evaluate our site for 508 accessibility compliance. It is flagging there is not enough color contrast in the display of the input schema: "Ensure that text and background colors have a 7:1 contrast ratio." Violates WCAG 2.0 AAA 1.4.6 https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html This is occurring on the

To reproduce...

Open a POST method, Expand Schemas, expand an input schema, then example data elements.

Expected behavior

enough color contrast.

Screenshots

Here's the screenshot of the display image

Here are the errors from Sort Site and the html context: image image image image

Additional context or thoughts

I would think the red asterisk marking "required" does not have enough color contrast either, because that element did not have enough contrast elsewhere.

mgifford commented 6 months ago

To find colors that meet the color contrast, I recommend https://contrast-finder.tanaguru.com/