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.31k stars 8.91k forks source link

a11y: "required" tag next to Request Body is not accessible #9572

Open ghost opened 7 months ago

ghost commented 7 months ago

Q&A (please complete the following information)

Content & configuration

Basic usage, no special configuration

Describe the bug you're encountering

We use Sort Site tool to evaluate our site for accessibility. It is flagging that the "required" tag next to the Request Body is not accessible: "Content inserted with CSS is not available to people who turn off style sheets or use custom styles. Move the content from CSS to the HTML page so that all users can see it". Violates WCAG 2.0 A F87 https://www.w3.org/TR/WCAG20-TECHS/F87.html This is happening in an h4 with classes "opblock-title parameter__name required"

In addition, this "required" tag is too small a font and the red is not dark enough to provide enough color contrast, both of which make it hard to read for those with visibility issues.

To reproduce...

Click to expand a method pane, e.g. a POST method, with a request body. Next to "Request body" is a very small "required" label.

Expected behavior

The "required" tag should be easily visible

Screenshots

image

Additional context or thoughts

Here's the Sort Site output with the error: image

mgifford commented 6 months ago

It would be nice if this were more flexible. You want it to be consistent with however the API is being shown.  Users don't want to learn the DKAN & Swagger UI's.  Certainly, there is a reasonably well tested model within Drupal. Definitely the "required" text is too small.